コード例 #1
0
    void Update()
    {
        if (input.GetKey(KeyCode.Keypad1))
        {
            if (input.IsPlaying())
            {
                Debug.Log("Recording: 1");
            }
            else
            {
                Debug.Log("1");
            }
        }

        if (input.GetKey(KeyCode.Keypad2))
        {
            if (input.IsPlaying())
            {
                Debug.Log("Recording: 2");
            }
            else
            {
                Debug.Log("2");
            }
        }

        if (input.GetKey(KeyCode.Keypad3))
        {
            if (input.IsPlaying())
            {
                Debug.Log("Recording: 3");
            }
            else
            {
                Debug.Log("3");
            }
        }

        if (Input.GetKeyDown(KeyCode.A))
        {
            input.StartRecording();
        }

        if (Input.GetKeyDown(KeyCode.D))
        {
            Record record = input.StopRecording();

            if (record != null)
            {
                input.Play(record);
            }
        }
    }
コード例 #2
0
ファイル: Player.cs プロジェクト: ccadori/recorder
        void Update()
        {
            if (input.GetKey(KeyCode.A))
            {
                transform.position -= transform.right * Time.deltaTime * velocity;
            }
            else if (input.GetKey(KeyCode.D))
            {
                transform.position += transform.right * Time.deltaTime * velocity;
            }

            if (input.GetKey(KeyCode.S))
            {
                transform.position -= transform.forward * Time.deltaTime * velocity;
            }
            else if (input.GetKey(KeyCode.W))
            {
                transform.position += transform.forward * Time.deltaTime * velocity;
            }
        }