예제 #1
0
    private Vector3 deltaPos; //用于记录root motion方式下模型的移动量

    void Awake()
    {
        //pi = GetComponent<playerInput>();//键盘控制
        pi    = GetComponent <JoyStickInput>();//手柄控制
        anim  = model.GetComponent <Animator>();
        rigid = GetComponent <Rigidbody>();
    }
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }