Inheritance: MonoBehaviour
Esempio n. 1
0
    public void OnResetRotation(IComponentEvent componentEvent)
    {
        ResetRotation resetRotation = componentEvent as ResetRotation;

        if (resetRotation.Type == MotionType.Dof4)
        {
            m_IsTweening  = false;
            m_MouseStick  = Vector2.zero;
            m_MouseStick6 = Vector2.zero;
            m_RotateAxis  = Vector3.zero;
            CameraManager.GetInstance().GetMainCamereComponent().SetTrackedObjectOffset(MainCameraComponent.CMType.Jet, Vector2.zero);
        }
        else if (resetRotation.Type == MotionType.Dof6)
        {
            m_IsTweening = false;
            m_MouseStick = Vector2.zero;
            Vector3 rotation = m_SpacecraftInputProperty.GetSyncTarget().eulerAngles;
            m_Rotation.x = rotation.x;
            m_Rotation.y = rotation.y;
            ClampRotation();
            Quaternion quaternion = Quaternion.Euler(m_Rotation);
            m_RotateAxis = (quaternion * Vector3.forward).normalized;
            CameraManager.GetInstance().GetMainCamereComponent().SetTrackedObjectOffset(MainCameraComponent.CMType.JetSpeedUp, Vector2.zero);
        }
    }
Esempio n. 2
0
 void ResetOnClick()
 {
     if (gameObject.tag == "Selected")
     {
         Command resetrotate = new ResetRotation(gameObject);
         resetrotate.Execute();
         CommandManager.Instance().addcommand(resetrotate);
     }
 }
Esempio n. 3
0
 public static void ResetPose(bool position, ResetRotation rotation)
 {
     ResetPose(position, (int)rotation);
 }