private void Awake() { var bounds = TilePrefab.GetComponent <Renderer>().bounds; edgeLength = bounds.size.x / 2; persistor = GameObject.FindGameObjectWithTag("GameStatsPersistor").GetComponent <GameStatsPersistor> (); GameStats = persistor.GameStats; mapData = GameStats.DungeonMap; mapData.CommitMovement(); }
void Awake() { #if UNITY_EDITOR DebugHelper.CreateGameStatsPersistor(); #endif this.GameStatsPersistor = GameObject.FindGameObjectWithTag("GameStatsPersistor") .GetComponent <GameStatsPersistor> (); this.GameStats = this.GameStatsPersistor.GameStats; GameObject.Find("Button").GetComponent <Button> ().onClick.AddListener(() => { SceneManager.LoadScene("mapScene"); }); }
// Use this for initialization void Start() { #if UNITY_EDITOR DebugHelper.CreateGameStatsPersistor(); #endif this.GameStatsPersistor = GameObject.FindGameObjectWithTag("GameStatsPersistor") .GetComponent <GameStatsPersistor> (); this.GameStats = this.GameStatsPersistor.GameStats; initUIElements(); startFight(); }