Exemplo n.º 1
0
 void RpcFinish(int x)
 {
     if (isServer)
     {
         return;
     }
     speed_dir = -1;
     if (isLocalPlayer)
     {
         Global.playable = false;
         playerControllerGUI pcg = gameObject.GetComponent <playerControllerGUI>();
         if (pcg != null)
         {
             pcg.finished = true;
             pcg.result   = x;
         }
     }
 }
Exemplo n.º 2
0
 void Start()
 {
     far_propeller_clip  = Resources.Load <AudioClip>("propeller_far_clip");
     near_propeller_clip = Resources.Load <AudioClip>("propeller_near_clip");
     if (isLocalPlayer && !start_with_autopilot)
     {
         GameObject c = Instantiate(camera_pref) as GameObject;
         c.transform.parent        = transform;
         c.transform.localPosition = new Vector3(0, -10, 0);
         c.transform.localRotation = Quaternion.Euler(Vector3.zero);
         Global.cam        = c.GetComponent <Camera>();
         Global.effects_as = c.AddComponent <AudioSource>();
         playerControllerGUI pcg = gameObject.AddComponent <playerControllerGUI>();
         pcg.cam = c;
         head.SetActive(false);
         pcg.pc          = this;
         Global.myPlayer = gameObject;
         c = Instantiate(Resources.Load <GameObject>("compass")) as GameObject;
         c.transform.parent        = transform;
         c.transform.localRotation = Quaternion.Euler(Vector3.zero);
         c.transform.localPosition = new Vector3(0, -11, 1.5f);
         Global.gmaster.compass    = c;
         pcg.cloud_emitter         = Instantiate(Resources.Load <GameObject>("cloud_emitter"));
         CmdRequestAssignment();
     }
     if (isServer)
     {
         scene_center = GameObject.Find("scene_center");
         if (start_with_autopilot)
         {
             Autopilot ap = gameObject.AddComponent <Autopilot>();
             ap.pc = this;
             AutoAssignment();
         }
     }
     hp = maxhp;
 }