// Use this for initialization void Start() { _sessionManager = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>(); _userInput = new LFUserInput(); _userInput.exitAction += CancelAction; ShowResult(); }
// Use this for initialization void Start() { _sessionManager = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>(); if (labyrinth != null) { _labyrinth = labyrinth.GetComponent <LFLabyrinthGeneration>(); _labyrinth.StartInitLabyrinth(); _grid = labyrinth.GetComponent <LFGrid>(); _grid.StartInitGrid(); _enemyGenerator = labyrinth.GetComponent <LFEnemyGenerator>(); _coinGenerator = labyrinth.GetComponent <LFCoinGenerator>(); _animalGenerator = labyrinth.GetComponent <LFAnimalGenerator>(); CreatePlayer(); } _time = 0.0f; _dayTime = changeDateStateTime; LFEventManager.coin += PlayerDidGetCoin; LFEventManager.gameOver += PlayerDidDie; if (_enemyGenerator != null) { //_enemyGenerator.CreateZombie(); for (int i = 0; i < 10; i++) { _enemyGenerator.CreateZombie(); } } if (_animalGenerator != null) { //_enemyGenerator.CreateZombie(); for (int i = 0; i < 10; i++) { _animalGenerator.CreatePing(); } } if (_player != null && camera != null) { camera.GetComponent <LFCameraFollow>().target = _player.transform; camera.GetComponent <LFCameraFollow> ().leftBottomCorner = GetBottomLeftCameraPos(); camera.GetComponent <LFCameraFollow> ().topRightCorner = GetTopRightCameraPos(); } if (_player != null && playeInfo != null) { playeInfo.player = _player; } UpdateDayState(); }
void Awake() { if (_instance) { DestroyImmediate(gameObject); return; } _instance = this; DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { _rowList = new List <GameObject> (); _sessionManager = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>(); if (_sessionManager != null && _sessionManager.GetCurrentSession() != null) { CreateLeadboardRows(); } _userInput = new LFUserInput(); _userInput.exitAction += CancelAction; }
// Use this for initialization void Start() { _userInput = new LFUserInput(); _userInput.exitAction += CancelAction; _sessionManager = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>(); if (_sessionManager != null && _sessionManager.GetCurrentSession() != null) { _session = _sessionManager.GetCurrentSession(); } playerName.text = _session.PlayerName; }