summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Doc/ROUNDS分析.xlsxbin6075929 -> 9613266 bytes
-rw-r--r--ROUNDS/.vs/ROUNDS/DesignTimeBuild/.dtbcache.v2bin116511 -> 116543 bytes
-rw-r--r--ROUNDS/.vs/ROUNDS/v17/.suobin155648 -> 172032 bytes
-rw-r--r--ROUNDS/_Player/CharacterData.cs503
-rw-r--r--ROUNDS/_Player/Gravity.cs1
-rw-r--r--ROUNDS/_Player/PlayerCollision.cs100
-rw-r--r--ROUNDS/_Player/PlayerVelocity.cs12
-rw-r--r--ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.dllbin909824 -> 908288 bytes
-rw-r--r--ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.pdbbin486972 -> 486512 bytes
-rw-r--r--ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.dllbin909824 -> 908288 bytes
-rw-r--r--ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.pdbbin486972 -> 486512 bytes
11 files changed, 333 insertions, 283 deletions
diff --git a/Doc/ROUNDS分析.xlsx b/Doc/ROUNDS分析.xlsx
index 6a3132f..9273472 100644
--- a/Doc/ROUNDS分析.xlsx
+++ b/Doc/ROUNDS分析.xlsx
Binary files differ
diff --git a/ROUNDS/.vs/ROUNDS/DesignTimeBuild/.dtbcache.v2 b/ROUNDS/.vs/ROUNDS/DesignTimeBuild/.dtbcache.v2
index 62e3f8e..de301f8 100644
--- a/ROUNDS/.vs/ROUNDS/DesignTimeBuild/.dtbcache.v2
+++ b/ROUNDS/.vs/ROUNDS/DesignTimeBuild/.dtbcache.v2
Binary files differ
diff --git a/ROUNDS/.vs/ROUNDS/v17/.suo b/ROUNDS/.vs/ROUNDS/v17/.suo
index db81732..8011a78 100644
--- a/ROUNDS/.vs/ROUNDS/v17/.suo
+++ b/ROUNDS/.vs/ROUNDS/v17/.suo
Binary files differ
diff --git a/ROUNDS/_Player/CharacterData.cs b/ROUNDS/_Player/CharacterData.cs
index 394fe79..be9f482 100644
--- a/ROUNDS/_Player/CharacterData.cs
+++ b/ROUNDS/_Player/CharacterData.cs
@@ -6,62 +6,60 @@ using UnityEngine.Serialization;
public class CharacterData : MonoBehaviour
{
- public Vector3 aimDirection;
+ public Vector3 aimDirection;
- public List<CardInfo> currentCards;
+ public List<CardInfo> currentCards;
- public PlayerActions playerActions;
+ public float sinceGroundedMultiplierWhenWallGrab = 0.2f;
- public ParticleSystem[] landParts;
+ public PlayerActions playerActions;
- public int jumps = 1;
+ public ParticleSystem[] landParts;
- public int currentJumps = 1;
+ public int jumps = 1;
- public bool isPlaying;
+ public int currentJumps = 1;
- public bool dead;
+ public bool isPlaying;
- public bool isStunned;
+ public bool dead;
- public bool isSilenced;
+ public bool isStunned;
- public float stunTime;
+ public bool isSilenced;
- public float silenceTime;
+ public float stunTime;
- public float health = 100f;
+ public float silenceTime;
- public float maxHealth = 100f;
+ public float health = 100f;
- public AnimationCurve slamCurve;
+ public float maxHealth = 100f;
- public Vector3 wallPos;
+ public AnimationCurve slamCurve;
- public Vector2 wallNormal;
+ public Vector3 wallPos;
- public Transform hand;
+ public Vector2 wallNormal;
- public float sinceWallGrab = float.PositiveInfinity;
+ public Vector3 groundPos;
- public bool isWallGrab;
+ public Transform hand;
- public float wallDistance = 1f;
+ public float sinceWallGrab = float.PositiveInfinity;
- private bool wasWallGrabLastFrame;
+ public bool isWallGrab;
- #region Ground
+ public float wallDistance = 1f;
- public Vector3 groundPos;
+ private bool wasWallGrabLastFrame;
public float sinceGrounded;
- public float sinceGroundedMultiplierWhenWallGrab = 0.2f;
-
// ԣisGroundedָʾǷŵ
[FormerlySerializedAs("isGrounded")]
- private bool m_IsGrounded = true;
- private bool m_preGrounded = true;
+ private bool m_IsGrounded = true;
+ private bool m_preGrounded = true;
public bool isGrounded
{
@@ -77,180 +75,209 @@ public class CharacterData : MonoBehaviour
}
}
- private bool wasGroundedLastFrame = true;
+ //#region Ground
+
+ //public Vector3 groundPos;
+
+ //public float sinceGrounded;
+
+ //public float sinceGroundedMultiplierWhenWallGrab = 0.2f;
+
+ //// ԣisGroundedָʾǷŵ
+ //[FormerlySerializedAs("isGrounded")]
+ //private bool m_IsGrounded = true;
+ //private bool m_preGrounded = true;
+
+ //public bool isGrounded
+ //{
+ // get { return m_IsGrounded; }
+ // set
+ // {
+ // m_IsGrounded = value;
+ // if (m_preGrounded != value)
+ // {
+ // //this.gameObject.name = "Player_" + value;
+ // }
+ // m_preGrounded = value;
+ // }
+ //}
+
+ //private bool wasGroundedLastFrame = true;
+
+ //#endregion
- #endregion
+ private bool wasGroundedLastFrame = true;
public Player player;
- public float sinceJump = 1f;
+ public float sinceJump = 1f;
+
+ public PlayerVelocity playerVel;
+
+ public HealthHandler healthHandler;
+
+ public GeneralInput input;
+
+ public PlayerMovement movement;
+
+ public PlayerJump jump;
+
+ public Block block;
+
+ public CharacterStatModifiers stats;
+
+ public WeaponHandler weaponHandler;
+
+ public StunHandler stunHandler;
+
+ public SilenceHandler silenceHandler;
+
+ public Player lastSourceOfDamage;
+
+ public Player master;
- public PlayerVelocity playerVel;
+ public Player lastDamagedPlayer;
- public HealthHandler healthHandler;
+ public Collider2D mainCol;
- public GeneralInput input;
+ public PlayerSounds playerSounds;
- public PlayerMovement movement;
+ private Transform wobblePos;
- public PlayerJump jump;
+ private LayerMask groundMask;
- public Block block;
+ public PhotonView view;
+
+ private CrownPos crownPos;
+
+ public Rigidbody2D standOnRig;
+
+ public Action<float, Vector3, Vector3, Transform> TouchGroundAction;
+
+ public Action<float, Vector3, Vector3> TouchWallAction;
+
+ public float HealthPercentage
+ {
+ get
+ {
+ return health / maxHealth;
+ }
+ internal set
+ {
+ }
+ }
+
+ private void Awake()
+ {
+ crownPos = GetComponentInChildren<CrownPos>();
+ view = GetComponent<PhotonView>();
+ mainCol = GetComponent<Collider2D>();
+ wobblePos = GetComponentInChildren<PlayerWobblePosition>().transform;
+ stats = GetComponent<CharacterStatModifiers>();
+ player = GetComponent<Player>();
+ weaponHandler = GetComponent<WeaponHandler>();
+ block = GetComponent<Block>();
+ input = GetComponent<GeneralInput>();
+ movement = GetComponent<PlayerMovement>();
+ jump = GetComponent<PlayerJump>();
+ stunHandler = GetComponent<StunHandler>();
+ silenceHandler = GetComponent<SilenceHandler>();
+ hand = GetComponentInChildren<HandPos>().transform;
+ playerVel = GetComponent<PlayerVelocity>();
+ healthHandler = GetComponent<HealthHandler>();
+ playerSounds = GetComponent<PlayerSounds>();
+ }
+
+ internal Vector3 GetCrownPos()
+ {
+ if ((bool)crownPos)
+ {
+ return crownPos.transform.position + Vector3.up * crownPos.GetOffset();
+ }
+ Debug.LogError("NO CROWN POS!?");
+ return Vector3.up * 1000f;
+ }
+
+ private void Start()
+ {
+ groundMask = LayerMask.GetMask("Default");
+ if (!view.IsMine)
+ {
+ PlayerManager.RegisterPlayer(player);
+ }
+ }
+
+ private void Update()
+ {
+ if (!playerVel.simulated)
+ {
+ sinceGrounded = 0f;
+ }
+ sinceJump += TimeHandler.deltaTime;
+ Wall();
+ }
- public CharacterStatModifiers stats;
+ private void FixedUpdate()
+ {
+ Ground();
+ }
- public WeaponHandler weaponHandler;
+ private void Ground()
+ {
+ if (!isPlaying)
+ {
+ return;
+ }
+ if (!isGrounded)
+ {
+ sinceGrounded += TimeHandler.fixedDeltaTime * ((isWallGrab && wallDistance < 0.7f) ? sinceGroundedMultiplierWhenWallGrab : 1f);
+ if (sinceGrounded < 0f)
+ {
+ sinceGrounded = Mathf.Lerp(sinceGrounded, 0f, TimeHandler.fixedDeltaTime * 15f);
+ }
+ }
+ if (!wasGroundedLastFrame)
+ {
+ isGrounded = false;
+ }
+ wasGroundedLastFrame = false;
+ }
- public StunHandler stunHandler;
+ private void Wall()
+ {
+ if (!isWallGrab)
+ {
+ sinceWallGrab += TimeHandler.deltaTime;
+ }
+ if (!wasWallGrabLastFrame)
+ {
+ isWallGrab = false;
+ }
+ wasWallGrabLastFrame = false;
+ }
- public SilenceHandler silenceHandler;
+ // ȽҪ
+ // ֻ isGrounded = true
+ public void TouchGround(Vector3 pos, Vector3 groundNormal, Rigidbody2D groundRig, Transform groundTransform = null)
+ {
+ //this.gameObject.name = "Player_" + pos.ToString() + "_" + (groundTransform != null ? groundTransform.gameObject.name : "null");
- public Player lastSourceOfDamage;
-
- public Player master;
-
- public Player lastDamagedPlayer;
-
- public Collider2D mainCol;
-
- public PlayerSounds playerSounds;
-
- private Transform wobblePos;
-
- private LayerMask groundMask;
-
- public PhotonView view;
-
- private CrownPos crownPos;
-
- public Rigidbody2D standOnRig;
-
- public Action<float, Vector3, Vector3, Transform> TouchGroundAction;
-
- public Action<float, Vector3, Vector3> TouchWallAction;
-
- public float HealthPercentage
- {
- get
- {
- return health / maxHealth;
- }
- internal set
- {
- }
- }
-
- private void Awake()
- {
- crownPos = GetComponentInChildren<CrownPos>();
- view = GetComponent<PhotonView>();
- mainCol = GetComponent<Collider2D>();
- wobblePos = GetComponentInChildren<PlayerWobblePosition>().transform;
- stats = GetComponent<CharacterStatModifiers>();
- player = GetComponent<Player>();
- weaponHandler = GetComponent<WeaponHandler>();
- block = GetComponent<Block>();
- input = GetComponent<GeneralInput>();
- movement = GetComponent<PlayerMovement>();
- jump = GetComponent<PlayerJump>();
- stunHandler = GetComponent<StunHandler>();
- silenceHandler = GetComponent<SilenceHandler>();
- hand = GetComponentInChildren<HandPos>().transform;
- playerVel = GetComponent<PlayerVelocity>();
- healthHandler = GetComponent<HealthHandler>();
- playerSounds = GetComponent<PlayerSounds>();
- }
-
- internal Vector3 GetCrownPos()
- {
- if ((bool)crownPos)
- {
- return crownPos.transform.position + Vector3.up * crownPos.GetOffset();
- }
- Debug.LogError("NO CROWN POS!?");
- return Vector3.up * 1000f;
- }
-
- private void Start()
- {
- groundMask = LayerMask.GetMask("Default");
- if (!view.IsMine)
- {
- PlayerManager.RegisterPlayer(player);
- }
- }
-
- private void Update()
- {
- if (!playerVel.simulated)
- {
- sinceGrounded = 0f;
- }
- sinceJump += TimeHandler.deltaTime;
- Wall();
- }
-
- private void FixedUpdate()
- {
- Ground();
- }
-
- private void Ground()
- {
- if (!isPlaying)
- {
- return;
- }
- if (!isGrounded)
- {
- sinceGrounded += TimeHandler.fixedDeltaTime * ((isWallGrab && wallDistance < 0.7f) ? sinceGroundedMultiplierWhenWallGrab : 1f);
- if (sinceGrounded < 0f)
- {
- sinceGrounded = Mathf.Lerp(sinceGrounded, 0f, TimeHandler.fixedDeltaTime * 15f);
- }
- }
- if (!wasGroundedLastFrame)
- {
- isGrounded = false;
- }
- wasGroundedLastFrame = false;
- }
-
- private void Wall()
- {
- if (!isWallGrab)
- {
- sinceWallGrab += TimeHandler.deltaTime;
- }
- if (!wasWallGrabLastFrame)
- {
- isWallGrab = false;
- }
- wasWallGrabLastFrame = false;
- }
-
- // ȽҪ
- // ֻ isGrounded = true
- public void TouchGround(Vector3 pos, Vector3 groundNormal, Rigidbody2D groundRig, Transform groundTransform = null)
- {
- this.gameObject.name = "Player_" + pos.ToString() + "_" + (groundTransform != null ? groundTransform.gameObject.name : "null");
-
- if (sinceJump > 0.2f)
- {
- currentJumps = jumps;
- }
- if (TouchGroundAction != null)
- {
- TouchGroundAction(sinceGrounded, pos, groundNormal, groundTransform);
- }
- if (groundRig == null)
- {
- standOnRig = null;
- }
- else if (!groundRig.GetComponent<NetworkPhysicsObject>())
- {
- standOnRig = groundRig;
- }
+ if (sinceJump > 0.2f)
+ {
+ currentJumps = jumps;
+ }
+ if (TouchGroundAction != null)
+ {
+ TouchGroundAction(sinceGrounded, pos, groundNormal, groundTransform);
+ }
+ if (groundRig == null)
+ {
+ standOnRig = null;
+ }
+ else if (!groundRig.GetComponent<NetworkPhysicsObject>())
+ {
+ standOnRig = groundRig;
+ }
if (playerVel.velocity.y < -20f && !isGrounded)
{
for (int i = 0; i < landParts.Length; i++)
@@ -263,55 +290,55 @@ public class CharacterData : MonoBehaviour
GamefeelManager.instance.AddGameFeel(Vector2.down * Mathf.Clamp((sinceGrounded - 0.5f) * 1f, 0f, 4f));
}
groundPos = pos;
- wasGroundedLastFrame = true;
- isGrounded = true;
- sinceGrounded = 0f;
- }
-
- public void TouchWall(Vector2 normal, Vector3 pos)
- {
- if (isGrounded)
- {
- return;
- }
- wallNormal = normal;
- wallPos = pos;
- groundPos = pos;
- wallDistance = Vector2.Distance(base.transform.position, pos);
- if (!(sinceJump < 0.15f))
- {
- currentJumps = jumps;
- if (TouchWallAction != null)
- {
- TouchWallAction(sinceWallGrab, pos, normal);
- }
- _ = sinceWallGrab;
- _ = 0.15f;
- sinceWallGrab = 0f;
- wasWallGrabLastFrame = true;
- isWallGrab = true;
- }
- }
-
- public bool ThereIsGroundBelow(Vector3 pos, float range = 5f)
- {
- RaycastHit2D raycastHit2D = Physics2D.Raycast(pos, Vector2.down, range, groundMask);
- if ((bool)raycastHit2D.transform && raycastHit2D.distance > 0.1f)
- {
- return true;
- }
- return false;
- }
-
- public void SetAI(Player aiMaster = null)
- {
- master = aiMaster;
- input.controlledElseWhere = true;
- GetComponent<PlayerAPI>().enabled = true;
- }
-
- public void SetWobbleObjectChild(Transform obj)
- {
- obj.transform.SetParent(wobblePos, worldPositionStays: true);
- }
+ wasGroundedLastFrame = true;
+ isGrounded = true;
+ sinceGrounded = 0f;
+ }
+
+ public void TouchWall(Vector2 normal, Vector3 pos)
+ {
+ if (isGrounded)
+ {
+ return;
+ }
+ wallNormal = normal;
+ wallPos = pos;
+ groundPos = pos;
+ wallDistance = Vector2.Distance(base.transform.position, pos);
+ if (!(sinceJump < 0.15f))
+ {
+ currentJumps = jumps;
+ if (TouchWallAction != null)
+ {
+ TouchWallAction(sinceWallGrab, pos, normal);
+ }
+ _ = sinceWallGrab;
+ _ = 0.15f;
+ sinceWallGrab = 0f;
+ wasWallGrabLastFrame = true;
+ isWallGrab = true;
+ }
+ }
+
+ public bool ThereIsGroundBelow(Vector3 pos, float range = 5f)
+ {
+ RaycastHit2D raycastHit2D = Physics2D.Raycast(pos, Vector2.down, range, groundMask);
+ if ((bool)raycastHit2D.transform && raycastHit2D.distance > 0.1f)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void SetAI(Player aiMaster = null)
+ {
+ master = aiMaster;
+ input.controlledElseWhere = true;
+ GetComponent<PlayerAPI>().enabled = true;
+ }
+
+ public void SetWobbleObjectChild(Transform obj)
+ {
+ obj.transform.SetParent(wobblePos, worldPositionStays: true);
+ }
}
diff --git a/ROUNDS/_Player/Gravity.cs b/ROUNDS/_Player/Gravity.cs
index 1d9cb83..c6fc7d3 100644
--- a/ROUNDS/_Player/Gravity.cs
+++ b/ROUNDS/_Player/Gravity.cs
@@ -1,5 +1,6 @@
using UnityEngine;
+//ʩ
public class Gravity : MonoBehaviour
{
public float gravityForce;
diff --git a/ROUNDS/_Player/PlayerCollision.cs b/ROUNDS/_Player/PlayerCollision.cs
index c998a15..612f8e0 100644
--- a/ROUNDS/_Player/PlayerCollision.cs
+++ b/ROUNDS/_Player/PlayerCollision.cs
@@ -4,6 +4,7 @@ using Photon.Pun;
using Sonigon;
using UnityEngine;
+//Ҫ
public class PlayerCollision : MonoBehaviour
{
[Header("Sounds")]
@@ -47,77 +48,90 @@ public class PlayerCollision : MonoBehaviour
// ԣע͵fixedupdateеӰײǿվڵ
+ // PlayerVelocityǿһµٶȺ󣬽ɫûݵ£Ϊײ⡣ע͵ɫͻ
+
private void FixedUpdate()
{
- if (checkForGoThroughWall && ignoreWallFor <= 0)
- {
- RaycastHit2D raycastHit2D = default(RaycastHit2D);
- RaycastHit2D[] array = Physics2D.RaycastAll(lastPos, (Vector2)base.transform.position - lastPos, Vector2.Distance(base.transform.position, lastPos), mask);
- for (int i = 0; i < array.Length; i++)
- {
- if (!(array[i].transform.root == base.transform.root))
- {
- Debug.DrawLine(lastPos, array[i].point, Color.green, 1f);
- if (!(Vector2.Angle(array[i].normal, (Vector2)base.transform.position - lastPos) < 90f) && (!raycastHit2D.transform || array[i].distance < raycastHit2D.distance))
- {
- raycastHit2D = array[i];
- }
- }
- }
- if ((bool)raycastHit2D)
- {
- base.transform.position = raycastHit2D.point + raycastHit2D.normal * 0.5f;
- if (data.healthHandler.flyingFor > 0f)
- {
- DoBounce(raycastHit2D);
- }
- }
- }
- ignoreWallFor--;
+ #region ǽ͵޹أҲйأ
+ if (checkForGoThroughWall && ignoreWallFor <= 0)
+ {
+ RaycastHit2D raycastHit2D = default(RaycastHit2D);
+ RaycastHit2D[] array = Physics2D.RaycastAll(lastPos, (Vector2)base.transform.position - lastPos, Vector2.Distance(base.transform.position, lastPos), mask);
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (!(array[i].transform.root == base.transform.root))
+ {
+ Debug.DrawLine(lastPos, array[i].point, Color.green, 1f);
+ if (!(Vector2.Angle(array[i].normal, (Vector2)base.transform.position - lastPos) < 90f) && (!raycastHit2D.transform || array[i].distance < raycastHit2D.distance))
+ {
+ raycastHit2D = array[i];
+ }
+ }
+ }
+ if ((bool)raycastHit2D)
+ {
+ base.transform.position = raycastHit2D.point + raycastHit2D.normal * 0.5f;
+ if (data.healthHandler.flyingFor > 0f)
+ {
+ DoBounce(raycastHit2D);
+ }
+ }
+ }
+ #endregion
+
+ #region ײ
+ ignoreWallFor--;
lastPos = base.transform.position;
- float num = cirCol.radius * base.transform.localScale.x;
- float num2 = cirCol.radius * base.transform.localScale.x * 0.75f;
- RaycastHit2D[] array2 = Physics2D.CircleCastAll(lastPos, num, (Vector2)base.transform.position - lastPos, Vector2.Distance(base.transform.position, lastPos), mask);
+ float realRadius = cirCol.radius * base.transform.localScale.x;
+ float innerRadius = cirCol.radius * base.transform.localScale.x * 0.75f;
+ // circlecolliderλúʹСΪοײ
+ RaycastHit2D[] array2 = Physics2D.CircleCastAll(lastPos, realRadius, (Vector2)base.transform.position - lastPos, Vector2.Distance(base.transform.position, lastPos), mask);
for (int j = 0; j < array2.Length; j++)
{
- if (array2[j].transform.root == base.transform.root)
+ if (array2[j].transform.root == base.transform.root) // ԼԼײ
{
continue;
}
- Vector2 vector = base.transform.position;
+ Vector2 characterPosition = base.transform.position;
Vector2 point = array2[j].point;
- float num3 = Vector2.Distance(vector, point);
- Vector2 normalized = (vector - point).normalized;
- float value = num + (0f - num3);
- float value2 = num2 + (0f - num3);
- value = Mathf.Clamp(value, 0f, 10f);
- value2 = Mathf.Clamp(value2, 0f, 10f);
+ float distToHitpoint = Vector2.Distance(characterPosition, point);
+ Vector2 dirFromHitpoint = (characterPosition - point).normalized;
+ float realPushAmount = realRadius + (0f - distToHitpoint);
+ float innerPushAmount = innerRadius + (0f - distToHitpoint);
+ realPushAmount = Mathf.Clamp(realPushAmount, 0f, 10f);
+ innerPushAmount = Mathf.Clamp(innerPushAmount, 0f, 10f);
+
NetworkPhysicsObject component = array2[j].transform.GetComponent<NetworkPhysicsObject>();
if ((bool)component)
{
component.Push(data);
}
+
if (vel.simulated || !vel.isKinematic)
{
- vel.transform.position += (Vector3)normalized * value2;
- if (Mathf.Abs(normalized.y) < 0.45f && Mathf.Abs(data.input.direction.x) > 0.1f && Vector3.Angle(data.input.direction, normalized) > 90f)
+ vel.transform.position += (Vector3)dirFromHitpoint * innerPushAmount; // ѽɫ
+ if (Mathf.Abs(dirFromHitpoint.y) < 0.45f && Mathf.Abs(data.input.direction.x) > 0.1f && Vector3.Angle(data.input.direction, dirFromHitpoint) > 90f)
{
- data.TouchWall(normalized, point);
+ data.TouchWall(dirFromHitpoint, point);
}
- vel.velocity += normalized * value * 10f * TimeHandler.timeScale;
- vel.velocity -= vel.velocity * value * 1f * TimeHandler.timeScale;
+ vel.velocity += dirFromHitpoint * realPushAmount * 10f * TimeHandler.timeScale;
+ vel.velocity -= vel.velocity * realPushAmount * 1f * TimeHandler.timeScale;
}
+
Player componentInParent = array2[j].transform.GetComponentInParent<Player>();
if (componentInParent != null && collideWithPlayerAction != null)
{
- collideWithPlayerAction(point, value * normalized, componentInParent);
+ collideWithPlayerAction(point, realPushAmount * dirFromHitpoint, componentInParent);
}
+
if (data.healthHandler.flyingFor > 0f)
{
DoBounce(array2[j]);
}
}
- lastPos = base.transform.position;
+ #endregion
+
+ lastPos = base.transform.position;
}
private void DoBounce(RaycastHit2D hit)
diff --git a/ROUNDS/_Player/PlayerVelocity.cs b/ROUNDS/_Player/PlayerVelocity.cs
index 47822f6..9355a5d 100644
--- a/ROUNDS/_Player/PlayerVelocity.cs
+++ b/ROUNDS/_Player/PlayerVelocity.cs
@@ -32,11 +32,14 @@ public class PlayerVelocity : MonoBehaviour
private void Start()
{
- data = GetComponent<CharacterData>();
+ data = GetComponent<CharacterData>();
}
private void FixedUpdate()
{
+ bool bAsign = false; // Ϊtrue
+ //velocity = new Vector2(velocity.x, -0.3f);
+ Vector2 preVel = velocity;
if (data.isPlaying)
{
if (isKinematic)
@@ -45,11 +48,16 @@ public class PlayerVelocity : MonoBehaviour
}
if (simulated && !isKinematic)
{
- velocity += Vector2.down * Time.fixedDeltaTime * TimeHandler.timeScale * 20f;
+ bAsign = true;//ȷʵ
+ velocity += Vector2.down * Time.fixedDeltaTime * TimeHandler.timeScale * 20f;
+
base.transform.position += Time.fixedDeltaTime * TimeHandler.timeScale * (Vector3)velocity;
base.transform.position = new Vector3(base.transform.position.x, base.transform.position.y, 0f);
}
}
+
+ // ֹʱٶΪ0,0
+ this.gameObject.name = "Player_" + bAsign + "_"+ velocity + "_"+ preVel;
}
internal void AddForce(Vector2 force, ForceMode2D forceMode)
diff --git a/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.dll b/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.dll
index 98dcc58..2105001 100644
--- a/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.dll
+++ b/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.dll
Binary files differ
diff --git a/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.pdb b/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.pdb
index 25eda73..50af66e 100644
--- a/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.pdb
+++ b/ROUNDS/bin/Debug/netstandard2.1/Assembly-CSharp.pdb
Binary files differ
diff --git a/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.dll b/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.dll
index 98dcc58..2105001 100644
--- a/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.dll
+++ b/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.dll
Binary files differ
diff --git a/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.pdb b/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.pdb
index 25eda73..50af66e 100644
--- a/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.pdb
+++ b/ROUNDS/obj/Debug/netstandard2.1/Assembly-CSharp.pdb
Binary files differ