コード例 #1
0
 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;
 }
コード例 #2
0
    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;
    }
コード例 #3
0
    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;
    }
コード例 #4
0
    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;
    }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
ファイル: CombatScene.cs プロジェクト: isaveu/starcontrol
    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);
    }
コード例 #7
0
ファイル: Pause_menu.cs プロジェクト: TeamFallingBacon/proj
 // Use this for initialization
 void Start()
 {
     unpause ();
     fuel = (FuelGauge) camera.GetComponent(typeof(FuelGauge));
 }
コード例 #8
0
    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;
    }
コード例 #9
0
ファイル: CombatScene.cs プロジェクト: hypno2000/starcontrol
    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);
    }
コード例 #10
0
ファイル: Player_Score.cs プロジェクト: TeamFallingBacon/proj
 // Use this for initialization
 void Start()
 {
     keeper = GameObject.Find ("ScoreKeeper");
     fuel = (FuelGauge) camera.GetComponent(typeof(FuelGauge));
     score = (Score_Keeper) keeper.GetComponent(typeof(Score_Keeper));
 }
コード例 #11
0
ファイル: StarMapScene.cs プロジェクト: hypno2000/starcontrol
 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;
 }
コード例 #12
0
ファイル: Player.cs プロジェクト: jaruchti/3DGame-Programming
        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();
        }
コード例 #13
0
ファイル: FuelGauge.cs プロジェクト: mburton89/Bear-Plane
 void Awake()
 {
     unitsOfFuel = 116;
     Instance    = this;
 }