コード例 #1
0
 public void OnAwake()
 {
     avGUI                = FindObjectOfType <AviatorGUI> ();
     ws                   = FindObjectOfType <WindScript> ();
     motionBlur           = FindObjectOfType <MotionBlur> ();
     parachuteStrSqale    = parachute.localScale;
     parachute.localScale = 0.01f * Vector3.one;
     parachute.GetChild(0).GetComponent <SkinnedMeshRenderer> ().enabled = false;
     hipSuitPoints    = new Transform[hipSuit.childCount];
     hipSuitRotations = new Vector3[hipSuit.childCount];
     isMobilePlatform = Application.isMobilePlatform;
     for (int i = 0; i < hipSuitRotations.Length; i++)
     {
         hipSuitPoints [i]    = hipSuit.GetChild(i);
         hipSuitRotations [i] = hipSuitPoints [i].localRotation.eulerAngles;
     }
     armSuitRotations = new Vector3[armSuits.Length];
     for (int i = 0; i < armSuitRotations.Length; i++)
     {
         armSuitRotations [i] = armSuits [i].localRotation.eulerAngles;
     }
     foreach (var item in joints)
     {
         item.OnStart();
     }
     posController.OnStartAnimation += (JointsPoseController controller) => {
         if (controller.NewPoseName == "Open parachute")
         {
             parachute.GetChild(0).GetComponent <SkinnedMeshRenderer> ().enabled = true;
         }
     };
     posController.OnAnimationComplete += (JointsPoseController controller) => {
         if (controller.NewPoseName == "Open parachute")
         {
             parachute.GetChild(0).GetComponent <SkinnedMeshRenderer> ().enabled = true;
         }
         SetCurrentState();
     };
 }
コード例 #2
0
 void Start()
 {
     //source = GetComponent <AudioSource> ();
     targetRotation = wingmanTransform.transform.localRotation;
     avGUI          = FindObjectOfType <AviatorGUI> ();
 }