public void StartEffect(CharacterController.State state) { switch (state) { case CharacterController.State.Warp: isPlaying = true; StartCoroutine(PlayAnimation()); break; default: Initialize(); break; } }
public void StartEffect(CharacterController.State state) { ParticleSystem.EmissionModule emission = particle.emission; switch (state) { case CharacterController.State.Run: particle.Play(); break; default: particle.Stop(); break; } }
private void RotateNMove(Vector2 direction, ref CharacterController.State state, ref CharacterController.Stat stat, float deltaTime, ref Translation translation, ref Rotation rot) { if (direction.sqrMagnitude < 0.01) { return; } var scaledMoveSpeed = stat.movementSpeed * deltaTime; // For simplicity's sake, we just keep movement in a single plane here. Rotate // direction according to world Y rotation of player. var move = Quaternion.Euler(0, translation.Value.y, 0) * new Vector3(direction.x, 0, direction.y); /* rot.Value.value.y += direction.x; * rot.Value.value.x = Mathf.Clamp(rot.Value.value.x - direction.y, -89, 89); */ translation.Value += (float3)move * scaledMoveSpeed; }