예제 #1
0
    public void StartEffect(CharacterController.State state)
    {
        switch (state)
        {
        case CharacterController.State.Warp:
            isPlaying = true;
            StartCoroutine(PlayAnimation());
            break;

        default:
            Initialize();
            break;
        }
    }
예제 #2
0
    public void StartEffect(CharacterController.State state)
    {
        ParticleSystem.EmissionModule emission = particle.emission;

        switch (state)
        {
        case CharacterController.State.Run:
            particle.Play();
            break;

        default:
            particle.Stop();
            break;
        }
    }
예제 #3
0
    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;
    }