public void ResetGame() { mapSystem = GameObject.FindWithTag("GameController").GetComponent <MapSystem1>(); if (mapSystem) { mapSystem.ResetGame(); } Close(); }
void Update() { if (!battleSystem && !mapSystem) { battleSystem = GameObject.FindWithTag("GameController").GetComponent <BattleSystem>(); mapSystem = GameObject.FindWithTag("GameController").GetComponent <MapSystem1>(); } if (battleSystem) { battleSystem.fade = this; } if (mapSystem) { mapSystem.fade = this; } }