void Awake()
 {
     if (s_Instance == null)
     {
         s_Instance = this;
     }
     //DontDestroyOnLoad(this);
 }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        if (m_Ship.m_CanMove == true)
        {
            if (m_MeshAnimator.enabled == false)
            {
                m_MeshAnimator.enabled = true;
            }

            m_MoveMaxSpeed = m_Ship.m_CSpeed / 10;



            //InputDetection for etablish which button is pushed
            InputDetection();

            //Define Direction for applying the speed or the transform and the camera mouvement
            DefineDirection();

            if (m_IsDashing)
            {
                m_MoveSpeed   = m_MoveMaxSpeed;
                m_IsMoving    = true;
                m_RotateSpeed = m_MoveMaxSpeed;
            }
            else
            {
                m_RotateSpeed = m_MoveMaxSpeed * 4;
            }

            // Move the ship
            m_Rigidbody.velocity = transform.forward * m_MoveSpeed;

            //Play the animations
            AnimationOnTheMesh();
        }
        else
        {
            m_MoveSpeed            = 0;
            m_Rigidbody.velocity   = Vector3.zero;
            m_MeshAnimator.enabled = false;
        }

        CameraEventManager.FOVActualize(this);
    }
 void Awake()
 {
     if (s_Instance == null)
         s_Instance = this;
     //DontDestroyOnLoad(this);
 }