void Start() { playerShip = FindObjectOfType(typeof(PlayerShip)) as Ship; crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; }
void Start() { crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; // player ship playerShip = Instantiate(playerShipPrefab) as SolarSystemPlayerShip; }
protected void Start() { hull = FindObjectOfType(typeof(Hull)) as Hull; inventory = FindObjectOfType(typeof(Inventory)) as Inventory; crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; massGauge = FindObjectOfType(typeof(MassGauge)) as MassGauge; powerGauge = FindObjectOfType(typeof(PowerGauge)) as PowerGauge; accelerationGauge = FindObjectOfType(typeof(AccelerationGauge)) as AccelerationGauge; fuelConsumptionGauge = FindObjectOfType(typeof(FuelConsumptionGauge)) as FuelConsumptionGauge; }
protected void Start() { hull = FindObjectOfType(typeof(Hull)) as Hull; inventory = FindObjectOfType(typeof(Inventory)) as Inventory; crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; massGauge = FindObjectOfType(typeof(MassGauge)) as MassGauge; powerGauge = FindObjectOfType(typeof(PowerGauge)) as PowerGauge; accelerationGauge = FindObjectOfType(typeof(AccelerationGauge)) as AccelerationGauge; fuelConsumptionGauge = FindObjectOfType(typeof(FuelConsumptionGauge)) as FuelConsumptionGauge; }
public void Dispose() { timer.Stop(); timer.Tick -= timer_Tick; if (SpeedGauge != null) { SpeedGauge.Dispose(); SpeedGauge = null; } if (RpmGauge != null) { RpmGauge.Dispose(); RpmGauge = null; } if (TempGauge != null) { TempGauge.Dispose(); TempGauge = null; } if (FuelGauge != null) { FuelGauge.Dispose(); FuelGauge = null; } if (TorqueGauge != null) { TorqueGauge.Dispose(); TorqueGauge = null; } if (Speed != null) { Speed = null; } if (Temperature != null) { Temperature = null; } if (RPM != null) { RPM = null; } if (Fuel != null) { Fuel = null; } if (Torque != null) { Torque = null; } }
void Start() { rootObjects = new List <GameObject>(); foreach (GameObject obj in UnityEngine.Object.FindObjectsOfType(typeof(GameObject))) { if (obj.transform.parent == null) { rootObjects.Add(obj); } } playerShip = FindObjectOfType(typeof(PlayerShip)) as Ship; hotSeatShip = FindObjectOfType(typeof(HotSeatShip)) as Ship; enemyShip = FindObjectOfType(typeof(AiShip)) as Ship; crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; playerShip.transform.position = new Vector3(11f, 0f, 0f); hotSeatShip.transform.position = new Vector3(-11f, 0f, 0f); }
// Use this for initialization void Start() { unpause (); fuel = (FuelGauge) camera.GetComponent(typeof(FuelGauge)); }
void Start() { crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; // player ship playerShip = Instantiate(playerShipPrefab) as SolarSystemPlayerShip; }
void Start() { rootObjects = new List<GameObject>(); foreach (GameObject obj in UnityEngine.Object.FindObjectsOfType(typeof(GameObject))) { if (obj.transform.parent == null) { rootObjects.Add(obj); } } playerShip = FindObjectOfType(typeof(PlayerShip)) as Ship; hotSeatShip = FindObjectOfType(typeof(HotSeatShip)) as Ship; enemyShip = FindObjectOfType(typeof(AiShip)) as Ship; crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; playerShip.transform.position = new Vector3(11f, 0f, 0f); hotSeatShip.transform.position = new Vector3(-11f, 0f, 0f); }
// Use this for initialization void Start() { keeper = GameObject.Find ("ScoreKeeper"); fuel = (FuelGauge) camera.GetComponent(typeof(FuelGauge)); score = (Score_Keeper) keeper.GetComponent(typeof(Score_Keeper)); }
void Start() { playerShip = FindObjectOfType(typeof(PlayerShip)) as Ship; crewGauge = FindObjectOfType(typeof(CrewGauge)) as CrewGauge; fuelGauge = FindObjectOfType(typeof(FuelGauge)) as FuelGauge; energyGauge = FindObjectOfType(typeof(EnergyGauge)) as EnergyGauge; }
private float velocity; // player velocity #endregion Fields #region Constructors /// <summary> /// Create a new player object. /// </summary> public Player() { // Place player Position = PlayerStartPos; UpdatePositionAndBoundingSphere(Position); // Setup player fields ForwardDirection = PlayerStartDirection; velocity = 0.0f; bonusScore = 0; fuel = MaxFuel; // Create displays sped = new Spedometer(); fuelGauge = new FuelGauge(); healthMeter = new HealthMeter(); // Get sound effects soundEffects = new PlayerSoundEffects(); }
void Awake() { unitsOfFuel = 116; Instance = this; }