コード例 #1
0
ファイル: PlayerController.cs プロジェクト: cajoho99/FNAB
    // Update is called once per frame
    void Update()
    {
        var     targetX        = Input.GetAxisRaw("Horizontal");
        var     targetY        = Input.GetAxisRaw("Vertical");
        Vector3 targetVelocity = new Vector2(targetX, targetY);

        targetVelocity.Normalize();
        targetVelocity    *= movementSpeed;
        rigidBody.velocity = Vector3.SmoothDamp(rigidBody.velocity, targetVelocity, ref velocity, smoothing);

        if (Input.GetKeyDown(KeyCode.N))
        {
            DayNightManager.ChangeTime();
        }
        if (Input.GetKeyDown(KeyCode.M))
        {
            Debug.Log(DayNightManager.Time);
        }
    }