void Start()
    {
        wavesManager = WavesManager.Instance;
        wavesManager.OnWaveNumberChange += WaveLabelChange;

        WaveLabelChange(wavesManager.WavesState);
    }
Esempio n. 2
0
 public void Awake()
 {
     waveScript = waveManager.GetComponent<WavesManager>();
     initLaneBounds();
     //Debug.Log("FIRSTBOUNDMIN: " + laneBounds[0].min);
     //Debug.Log("FIRSTBOUNDMAX: " + laneBounds[0].max);
 }
 private void Awake()
 {
     mainMenuBlock    = GameObject.FindGameObjectWithTag(Tags.MainMenuBlock);
     pauseBlock       = GameObject.FindGameObjectWithTag(Tags.PauseBlock);
     cameraController = GameObject.FindGameObjectWithTag(Tags.MainCamera).GetComponent <CameraController>();
     waveManager      = GameObject.FindGameObjectWithTag(Tags.WavesManager).GetComponent <WavesManager>();
     enemySpawner     = GameObject.FindGameObjectWithTag(Tags.EnemiesSpawner).GetComponent <EnemySpawner>();
 }
Esempio n. 4
0
 // ottiene le istanze dei sotto-moduli di games manager: wavesmanager, scoremanager etc. etc.
 void getSubManagerModulesIstances()
 {
     wavesManager    = GameObject.FindGameObjectWithTag("WavesManager").GetComponent <WavesManager>();
     scoreManager    = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManager>();
     upgradesManager = GameObject.FindGameObjectWithTag("UpgradesManager").GetComponent <UpgradesManager>();
     mainHUDManager  = GameObject.FindGameObjectWithTag("MainHUD").GetComponent <MainHUDManager>();
     healsManager    = GameObject.FindGameObjectWithTag("HealsManager").GetComponent <HealsManager>();
 }
 void Awake()
 {
     if (_instance != null)
     {
         Debug.LogError("More than one instance of a singleton detected");
         return;
     }
     _instance = this;
 }
Esempio n. 6
0
    void Awake()
    {
        if (instance != null)
        {
            Debug.Log("Another instance of WavesManager already exists !");
        }

        instance = this;
    }
Esempio n. 7
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        WavesManager manager = (WavesManager)target;

        if (GUILayout.Button("Generate wave file"))
        {
            manager.GenerateWave();
        }
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Debug.LogError("Duplicated WavesManager", gameObject);
     }
 }
Esempio n. 9
0
 // Use this for initialization
 protected void Start()
 {
     zombieSpawner = FindObjectOfType <ZombieSpawner>();
     wavesManager  = FindObjectOfType <WavesManager>();
     aliveZombies.Add(this);
     SetUpGame.MakeSmaller(gameObject);
     CreateZombie();
     player      = FindObjectOfType <PlayerAttack>();
     rigidBody2d = GetComponent <Rigidbody2D>();
     InvokeRepeating("CheckForSamePosZombies", 4.765f, 5f);
 }
Esempio n. 10
0
    int currentWave;                             //Vague actuellement jouee

    //Initialisation
    void Awake()
    {
        _Instance     = this;
        finishedWaves = new bool[waves.Count];
        for (int i = 0; i < finishedWaves.Length; i++)
        {
            finishedWaves[i] = false;
        }

        currentWave    = 0;
        waveCount.text = "Préparez-vous !";
    }
Esempio n. 11
0
    void Start()
    {
        wavesManager = WavesManager.Instance;

        startWaveButtons = new List <StartWaveButton>();

        for (int i = 0; i < ownTransform.childCount; i++)
        {
            Transform       child           = ownTransform.GetChild(i);
            StartWaveButton startWaveButton = child.GetComponent <StartWaveButton>();
            if (startWaveButton != null)
            {
                startWaveButtons.Add(startWaveButton);
            }
        }
    }
Esempio n. 12
0
    public override void OnInspectorGUI()
    {
        WavesManager spawn = (WavesManager)target;

        if (DrawDefaultInspector())
        {
            // spawn.RotateLeft();
        }

        int   num  = 0;
        float time = 0;

        foreach (WavesManager.Waves w in spawn.wavesPattern)
        {
            w.id   = "Waves n°" + num++;
            w.time = time;
            time  += w.duration;
            //if(w.current)
        }
    }
Esempio n. 13
0
        public static void BeginWaveEditing(GameObject spawnpoint, WavesManager wavesmanager)
        {
            EditorSceneManager.SaveOpenScenes();

            if (spawnpoint == null)
            {
                Debug.Log("Need a spawnpoint to edit");
                return;
            }

            if (wavesmanager == null)
            {
                Debug.Log($"Must have one component <{nameof(WavesManager)}> attached");
                return;
            }

            //Pre-setup for wave editor scene.
            GameObject spawnobjectcopy = WaveEditorHelper.BuildBareMeshCopy(spawnpoint);

            spawnobjectcopy.name = "Spawn-Preview";

            spawnobjectcopy.AddComponent <ImmutableGameObject>();

            spawnobjectcopy.transform.position = spawnpoint.transform.position;
            spawnobjectcopy.transform.rotation = spawnpoint.transform.rotation;

            HideAllObjectsExcept(spawnobjectcopy);
            Selection.activeGameObject = spawnobjectcopy;
            SceneView.lastActiveSceneView.FrameSelected();

            var editorgui = new WaveEditorSceneContext(spawnobjectcopy, wavesmanager.WavesContainer, () =>
            {
                RestoreOriginalScene();
                GameObject.DestroyImmediate(spawnobjectcopy);
            });
        }
Esempio n. 14
0
 private void Awake()
 {
     instance = this;
 }
Esempio n. 15
0
 void Start()
 {
     wavesManager = WavesManager.Instance;
 }
Esempio n. 16
0
 void Awake()
 {
     Instance = this;
     waves    = FindObjectOfType <WavesManager>();
 }
Esempio n. 17
0
 void Start()
 {
     wavesManager = WavesManager.Instance;
     button.onClick.AddListener(wavesManager.StartWave);
     PrepareCicrleBar();
 }
Esempio n. 18
0
 private void Awake()
 {
     cameraController = GameObject.FindGameObjectWithTag(Tags.MainCamera).GetComponent <CameraController>();
     brain            = GameObject.FindGameObjectWithTag(Tags.Brain);
     waveManager      = GameObject.FindGameObjectWithTag(Tags.WavesManager).GetComponent <WavesManager>();
 }