Beispiel #1
0
        public void LeaveControl()
        {
            if (this.spaceShip != null)
            {
                this.spaceShip.engineOn = false;
                this.spaceShip.pitchOn  = 0;
                this.spaceShip.rollOn   = 0;
            }

            if (this.lightShip != null)
            {
                this.lightShip.engineOn                = false;
                this.lightShip.pitchOn                 = 0;
                this.lightShip.rollOn                  = 0;
                this.transform.parent                  = this.lightShip.transform.parent;
                this.cRigidbody.isKinematic            = false;
                this.GetComponent <Collider>().enabled = true;
                this.state       = HumanoidState.Stand;
                this.currentGrav = this.transform.parent.GetComponent <Gravity> ();
            }

            this.cRigidbody.isKinematic            = false;
            this.GetComponent <Collider>().enabled = true;

            this.seat               = null;
            this.spaceShip          = null;
            this.lightShip          = null;
            this.head.localRotation = Quaternion.identity;
            this.state              = HumanoidState.Stand;
        }
Beispiel #2
0
 public void TakeControl(LightShip lightShip, Transform seat)
 {
     this.seat                              = seat;
     this.lightShip                         = lightShip;
     this.cTransform.parent                 = this.lightShip.transform;
     this.cRigidbody.isKinematic            = true;
     this.GetComponent <Collider>().enabled = false;
     this.state                             = HumanoidState.PilotLightShip;
 }
Beispiel #3
0
		public void LeaveControl () {
			if (this.spaceShip != null) {
				this.spaceShip.engineOn = false;
				this.spaceShip.pitchOn = 0;
				this.spaceShip.rollOn = 0;
			}

			if (this.lightShip != null) {
				this.lightShip.engineOn = false;
				this.lightShip.pitchOn = 0;
				this.lightShip.rollOn = 0;
				this.transform.parent = this.lightShip.transform.parent;
				this.cRigidbody.isKinematic = false;
				this.GetComponent<Collider>().enabled = true;
				this.state = HumanoidState.Stand;
				this.currentGrav = this.transform.parent.GetComponent<Gravity> ();
			}

			this.cRigidbody.isKinematic = false;
			this.GetComponent<Collider>().enabled = true;

			this.seat = null;
			this.spaceShip = null;
			this.lightShip = null;
			this.head.localRotation = Quaternion.identity;
			this.state = HumanoidState.Stand;
		}
Beispiel #4
0
		public void TakeControl (LightShip lightShip, Transform seat) {
			this.seat = seat;
			this.lightShip = lightShip;
			this.cTransform.parent = this.lightShip.transform;
			this.cRigidbody.isKinematic = true;
			this.GetComponent<Collider>().enabled = false;
			this.state = HumanoidState.PilotLightShip;
		}