예제 #1
0
 void Start()
 {
     flight = this.GetComponent <FlightSystem> ();
     View   = (FlightView)GameObject.FindObjectOfType(typeof(FlightView));
     // setting all Touch screen controller in the position
     controllerTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, Screen.height - 100));
     fireTouch       = new TouchScreenVal(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height));
     switchTouch     = new TouchScreenVal(new Rect(0, Screen.height - 100, Screen.width / 2, 100));
     sliceTouch      = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, 50));
 }
예제 #2
0
 void Start()
 {
     timetolockcount  = Time.time;
     flight           = this.GetComponent <FlightSystem> (); // get Flight System
     flight.AutoPilot = true;                                // set auto pilot to true will make this plane flying and looking to Target automatically
     timestatetemp    = 0;
     if (!CenterOfBattle)
     {
         BattleCenter btcenter = (BattleCenter)GameObject.FindObjectOfType(typeof(BattleCenter));
         if (btcenter != null)
         {
             CenterOfBattle = btcenter.gameObject.GetComponent <BattleCenter> ();
         }
     }
 }
예제 #3
0
// core plane system

        void Awake()
        {
            if (CockpitCamera.Length <= 0)
            {
                if (this.transform.GetComponentsInChildren(typeof(Camera)).Length > 0)
                {
                    var cams = this.transform.GetComponentsInChildren(typeof(Camera));
                    CockpitCamera = new Camera[cams.Length];
                    for (int i = 0; i < cams.Length; i++)
                    {
                        CockpitCamera [i] = cams [i].GetComponent <Camera>();
                    }
                }
            }
            flight = this.GetComponent <FlightSystem> ();
        }
예제 #4
0
 void Awake()
 {
     flight = this.GetComponent <FlightSystem> ();
 }