예제 #1
0
    // Use this for initialization
    void Start()
    {
        mainThruster       = gameObject.transform.Find("Thrusters/MainThruster").GetComponent <Nozzle> ();
        frontLeftThruster  = gameObject.transform.Find("Thrusters/FrontLeftThruster").GetComponent <Nozzle> ();
        frontRightThruster = gameObject.transform.Find("Thrusters/FrontRightThruster").GetComponent <Nozzle> ();
        backLeftThruster   = gameObject.transform.Find("Thrusters/BackLeftThruster").GetComponent <Nozzle> ();
        backRightThruster  = gameObject.transform.Find("Thrusters/BackRightThruster").GetComponent <Nozzle> ();
        frontThruster1     = gameObject.transform.Find("Thrusters/FrontThruster1").GetComponent <Nozzle> ();
        frontThruster2     = gameObject.transform.Find("Thrusters/FrontThruster2").GetComponent <Nozzle> ();

        if (weapons.Length != 0)
        {
            activeWeapon = weapons[0]; weaponIndex = 1;
        }
        else
        {
            weaponIndex = 0;
        }

        radar           = gameObject.transform.Find("Radar").GetComponent <RadarController>();
        radar.pingReach = radarRange;
        radar.SetRadarOff();
        initialFuel = fuel; fuelIsBingo = false;

        pidController = gameObject.GetComponent <PIDController> ();
        if (gameObject.tag == "Vessel")
        {
            StartCoroutine(ClearSpaceAroundShip(false, 0.1f));
        }
    }