void Start() { gameManager = GameManager.Instance; fusionManager = FindObjectOfType <FusionManager>(); stageManager = FindObjectOfType <StageManager>(); mapSliderScript = FindObjectOfType <MapSliderScript>(); audi = GetComponent <AudioSource>(); anim = GetComponent <Animator>(); int enemyUnitNum = fusionManager.GetEnemyUnitNum() + 1; fusionManager.SetEnemyUnitNum(enemyUnitNum); firstHeart = heart; firstDp = dp; spawnStrongestNum = Random.Range(0, strongestSpawned.Length); for (int i = 0; i < gameManager.GetSaveData().currentStage; i++) { setStat(); } SetMaxHealth(); }
public void StageReset() { stageClearPopUp.SetActive(false); gameManager.SetCSt(true); fusionManager.enemyBuildingScript.Reset(); fusionManager.buildingScript.Reset(); fusionManager.SetUnitNO(0); fusionManager.SetEnemyUnitNO(0); useMoneyNum = 0; deathPlayerUnitNum = 0; killedEnemyUnitNum = 0; saveData.maxStatLev = 5 + 5 * (saveData.maxReachedStage / 10); foreach (var item in fusionManager.unitScript) { item.Destroye(); } fusionManager.unitScript = new UnitScript[0]; fusionManager.SetUnitNum(1); foreach (var item in fusionManager.enemyScript) { item.Destroye(); } fusionManager.enemyScript = new EnemyScript[0]; fusionManager.SetEnemyUnitNum(1); while (fusionManager.projectionScripts.Count > 0) { if (fusionManager.projectionScripts[0] != null) { Destroy(fusionManager.projectionScripts[0].gameObject); fusionManager.projectionScripts.Remove(fusionManager.projectionScripts[0]); } else if (fusionManager.projectionScripts[0] == null) { Destroy(fusionManager.projectionScripts[0].gameObject); fusionManager.projectionScripts.Remove(fusionManager.projectionScripts[0]); } } gameManager.Reset(); }
private void PlusEnemyNum() { fusionManager.SetEnemyUnitNum(thisUnitNum = fusionManager.GetEnemyUnitNum() + 1); fusionManager.SetEnemyUnitNO(thisUnitNO = fusionManager.GetEnemyUnitNO() + 1d); }