private void Start()
 {
     if (this.findTarget)
     {
         this.target = Object.FindObjectOfType <PA_DronePack.DroneController>();
         if (this.target == null)
         {
             Debug.LogWarning("PA_DroneCamera could not find a drone target", base.get_gameObject());
         }
     }
     if (this.findFPS)
     {
         this.fpsPosition = GameObject.Find("FPSView").get_transform();
         if (this.fpsPosition == null)
         {
             Debug.LogWarning("PA_DroneCamera could not find an FPS position", base.get_gameObject());
         }
     }
     if (!this.autoPosition || !this.target)
     {
         if (!this.target)
         {
             Debug.LogError("ERROR: PA_DroneCamera is missing a target");
         }
     }
     else
     {
         float num  = Mathf.Abs(this.target.get_transform().get_position().x - base.get_transform().get_position().x);
         float num2 = Mathf.Abs(this.target.get_transform().get_position().z - base.get_transform().get_position().z);
         this.distance = (num > num2) ? num : num2;
         this.height   = Mathf.Abs(this.target.get_transform().get_position().y - base.get_transform().get_position().y);
         this.angle    = base.get_transform().get_eulerAngles().x;
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     this.dcoScript = base.GetComponent <PA_DronePack.DroneController>();
     this.dcScript  = Object.FindObjectOfType <PA_DronePack.DroneCamera>();
     this.UpdateInput();
 }