Esempio n. 1
0
 // Start is called before the first frame update
 void Start()
 {
     _movement            = GetComponentInChildren <AircraftMovement>();
     _textureManager      = GetComponent <AircraftTextureManager>();
     _aircraftAudioSource = gameObject.AddComponent <AudioSource>();
     timeControl          = FindObjectOfType <TimeControl>();
 }
Esempio n. 2
0
 private void Start()
 {
     playerAircraft     = player.GetComponentInParent <AircraftMovement>();
     playerRigidbody    = player.GetComponentInParent <Rigidbody>();
     jet                = JetStatus.Get();
     explosionParticles = explosion.GetComponent <ParticleSystem>();
 }
 // Start is called before the first frame update
 private void Start()
 {
     jet            = JetStatus.Get();
     playerMovement = player.GetComponent <AircraftMovement>();
     playerGravity  = player.GetComponent <Rigidbody>();
     fuelBar        = GetComponent <Scrollbar>();
 }
    public void destroyCloseAirplanes()
    {
        if (airplanesMovement != null)
        {
            for (int i = 0; i < airplanesMovement.Count; ++i)
            {
                AircraftMovement am1 = (AircraftMovement)airplanesMovement [i];
                for (int j = i + 1; j < airplanesMovement.Count; ++j)
                {
                    AircraftMovement am2 = (AircraftMovement)airplanesMovement [j];
                    if (Vector3.Distance(am1.getAirplanePosition(), am2.getAirplanePosition()) < 1)
                    {
                        // Remove it from collections
                        airplanesMovement.Remove(am1);
                        airplanesMovement.Remove(am2);

                        // Destroy ATCs
                        Destroy(am1.transform.parent.gameObject);
                        Destroy(am2.transform.parent.gameObject);

                        // Stop Playing alarm
                        stopAlert();
                        // Increase variable in  Visualization Data
                        VisualizationDataController.vdCtrl.totalCollisions += 2;
                    }
                }
            }
        }
    }
Esempio n. 5
0
    public void Start()
    {
        childrenTranformCopy = new ArrayList();

        airplane = transform.parent.Find(Constants.MYAIRPLANE);
        scriptAircraftMovement = airplane.GetComponent <AircraftMovement> ();
        transform.LookAt(scriptAircraftMovement.getCurrentTarget());
    }
Esempio n. 6
0
    void Start()
    {
        float distance       = DataController.dataCtrl.currentDistance;
        float positionNumber = float.Parse(gameObject.name);

        transform.Translate(new Vector3(0.0f, 0.0f, distance * positionNumber));

        // Script
        GameObject myAirplane = transform.parent.parent.FindChild(Constants.MYAIRPLANE).gameObject;

        aircraftMovementScript = myAirplane.GetComponent <AircraftMovement> ();
        nextTarget             = aircraftMovementScript.getCurrentTarget();
    }
Esempio n. 7
0
 // Start is called before the first frame update
 private void Start()
 {
     oldPanelColor             = new Vector4(0, 0, 0, 0.7f);
     playerStatus              = JetStatus.Get();
     EnemiesDestroyedSingleton = EnemiesDestroyed.Get();
     playerAircraft            = player.GetComponent <AircraftMovement>();
     playerCamera              = player.GetComponent <AircraftCamera>();
     UIPanel = panel.GetComponent <Image>();
     enemiesDestroyedText.text = "";
     finishText.text           = "";
     UIPanel.color             = new Vector4(0, 0, 0, 0);
     Cursor.visible            = false;
     levelStatus = GetComponent <LevelStatus>();
 }
Esempio n. 8
0
    IEnumerator RestartCoroutine()
    {
        _targetStart   = 0;
        _targetRestart = 0;
        _targetTitle   = 0;
        Lost           = false;
        Time.timeScale = 1f;
        _score         = 0;
        _targetScore   = 0;
        EnergyLeft     = 100;
        Destroy(GameObject.FindGameObjectWithTag("Player"));

        OpenSimplexNoise.Load(Random.Range(int.MinValue, int.MaxValue));

        World world = GameObject.FindGameObjectWithTag("World").GetComponent <World>();

        Chunk[] chunks = null;
        lock (world.Chunks)
            chunks = world.Chunks.Values.ToList().ToArray();

        for (int i = 0; i < chunks.Length; i++)
        {
            world.RemoveChunk(chunks[i]);
        }

        GameObject go =
            Instantiate <GameObject>(PlayerPrefab, Vector3.zero, Quaternion.identity);

        world.Player      = go;
        _aircraftMovement = go.GetComponentInChildren <AircraftMovement>();
        go.GetComponent <AircraftMaster>().timeControl = this.GetComponent <TimeControl>();
        GameObject.FindGameObjectWithTag("MainCamera").GetComponent <FollowShip>()
        .PlayerGameObject = go;

        yield return(null);
    }
 void Start()
 {
     airplaneScript = airplane.GetComponent <AircraftMovement> ();
 }