void Start() { playSessionManager = GameObject.Find("PlaySessionManager").GetComponent <PlaySessionManager> (); armor = armorStart; hp = hpStart; target = Path.points [pathIndex]; }
void Start() { playSessionManager = GameObject.Find("PlaySessionManager").GetComponent <PlaySessionManager> (); textPrice.text = tower.priceBuy.ToString(); // при изменении playSessionManager.OnMoneyChange += UpdateAccessibility; }
void Start() { playSessionManager = GameObject.Find("PlaySessionManager").GetComponent <PlaySessionManager> (); // поиск ближайшего врага каждые 0,5 секунды InvokeRepeating("UpdateTarget", 0f, 0.5f); // скрыть GUI башни UIselected.SetActive(false); // редактирование размерв GUI дальности стрельбы UIfireRange.transform.localScale = new Vector3(range, range, 0f); }
private void Awake() { if (ins == null) { ins = this; } else if (ins != this) { Destroy(gameObject); return; } }
void Awake() { if (instance == null) { instance = this; SceneManager.sceneLoaded += OnSceneLoad; DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(gameObject); } }
void Start() { playSessionManager = GameObject.Find("PlaySessionManager").GetComponent <PlaySessionManager> (); spawnPoint = GameObject.Find("WayPointStart"); waves = new SubWave[10, 10]; waves = DataTransfer.levelsWavesList[DataTransfer.chosenLevel]; subWaveIndexMax = DataTransfer.subWavesAmount; waveIndexMax = DataTransfer.wavesAmount; // Спавн всех волн StartCoroutine(SpawnWaves()); }
// Singleton Pattern, OnSceneLoad Method Added private void Awake() { if (ins == null) { ins = this; DontDestroyOnLoad(gameObject); } else if (ins != this) { Destroy(gameObject); return; } SceneManager.sceneLoaded += OnSceneLoad; }
void Awake() // Runs when script is loaded, before game runs { // Singleton Pattern to have a single instance of the PlaySession manager if (ins == null) //Checks whether there is already an Instance, { ins = this; //If there is no instance sets itself to be the instance DontDestroyOnLoad(gameObject); //Makes it so the object will persist through scenes } else if (ins != this) //if the instance is set to something other than this object { Destroy(gameObject); //destroy this object as there is already a different instance return; // returns to prevent running any more code in this method // as it can take a short time for the object to be destroyed } }
void Awake() { //Singleton pattern if (ins == null) { ins = this; DontDestroyOnLoad(gameObject); } else if (ins != this) { Destroy(gameObject); return; } //Get player data data = SaveManager.LoadGameData(); furthestLevel = data.furthestLevel; //Subscribe to level events SceneManager.sceneLoaded += OnSceneLoad; LevelManager.OnLevelEnd += HandleLevelEnd; }
void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; DontDestroyOnLoad(this); } audioManager = FindObjectOfType <AudioManager>(); levelManager = FindObjectOfType <LevelManager>(); playSessionManager = FindObjectOfType <PlaySessionManager>(); uiManager = FindObjectOfType <UIManager>(); playerManager = FindObjectOfType <PlayerManager>(); eventSystem = FindObjectOfType <EventSystem>(); mainCamera = FindObjectOfType <Camera>(); poolManager = FindObjectOfType <PoolManager>(); enemyManager = FindObjectOfType <EnemyManager>(); cameraControl = FindObjectOfType <CameraControl>(); }