public virtual void PlayEffect(Animator animator, Rigidbody rb, VestState vestState) { if (vestState == VestState.WithoutVest) { noVestCollidingEffect.PlayEffect(animator, rb); } //else //withVestCollidingEffect.PlayEffect(animator, rb); }
public override void PlayEffect(Animator animator, Rigidbody rb, VestState vestState) { if (vestState == VestState.WithoutVest) { noVestCollidingEffect.PlayEffect(animator, rb); } else { Vector3 inLaneForce = (rb.transform.position - transform.position).normalized * tileConfig.keepInLaneForce; rb.AddForce(inLaneForce, ForceMode.VelocityChange); } }
public void SetWorkerCollision(VestState vestState) { switch (vestState) { case VestState.WithoutVest: colliderRefUpdate.m_ICollide = workerWithoutVestCollide; break; case VestState.WithVest: colliderRefUpdate.m_ICollide = workerWithVestCollide; break; } }