public void TakeAirCraftControl(AirCraft a) { this.airCraft = a; this.SetKinematic(true); this.transform.SetParent(a.transform, true); this.transform.localPosition = Vector3.zero; this.transform.localRotation = Quaternion.identity; this.playerMode = Player.PlayerState.PilotAirCraft; a.TakeOff(this); }
public void TakeAirCraftControl(AirCraft a) { this.airCraft = a; this.SetKinematic (true); this.transform.SetParent (a.transform, true); this.transform.localPosition = Vector3.zero; this.transform.localRotation = Quaternion.identity; this.playerMode = Player.PlayerState.PilotAirCraft; a.TakeOff (this); }
public static void TwoAdapter() { IAircraft aircraft = new AirCraft(); aircraft.TakeOff(); if (aircraft.IsAirBrone) { Console.WriteLine("Aircraft engine is fine, fly at the height of "+aircraft.Height + " meters"); } //ISeaCraft seaCraft = new SeaCraft(); IAircraft seabird = new Seabird(); seabird.TakeOff(); ((ISeaCraft)seabird).IncreaseRev(); ((ISeaCraft)seabird).IncreaseRev(); ((ISeaCraft)seabird).IncreaseRev(); if (seabird.IsAirBrone) { Console.WriteLine("Seabird flying at height of " + seabird.Height + " meters and speed of " + ((ISeaCraft)seabird).Speed + " knots"); } }