public EnemyStatus(Enemy enemy, EnemyTable.TableRow table, int floorIndex) { this.enemy = enemy; this.table = table; this.floorIndex = floorIndex; InitHP(); debuffList = new List <DebuffParam>(); }
public void Init(int level, EnemyTable.TableRow table) { if (gameObject.activeSelf == false) { gameObject.SetActive(true); } status = new EnemyStatus(this, level, table); MovePosition(status.GetFloorIndex); InitHpBar(); }
public void Preload(EnemyTable.TableRow enemyTable) { if (gameObject.activeSelf == false) { gameObject.SetActive(true); } enemyStatus = new EnemyStatus(this, enemyTable); if (PoolManager.Instance != null) { PoolManager.Instance.AddEnemyPool(this); } }
public void MakeEnemy(int level, EnemyTable.TableRow table) { Enemy enemy = null; if (PoolManager.Instance != null && PoolManager.Instance.GetEnemyFromPool(table.id, out enemy)) { enemy.Init(level, table); } else { LoadAssetbundle.LoadPrefabCB loadPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadEnemyCompleteCB); PrefabManager.Instance.LoadPrefab(table.path, System.Guid.NewGuid(), loadPrefabCB, level, table); } }
public void Init(EnemyTable.TableRow enemyTable, int floorIndex) { if (gameObject.activeSelf == false) { gameObject.SetActive(true); } enemyStatus = new EnemyStatus(this, enemyTable, floorIndex); transform.localPosition = GameManager.Instance.GetEnemyStartPos(floorIndex); skeletonAnim.gameObject.transform.localPosition = Vector3.forward * floorIndex; SetState(eProcessType.Type_Move); }
private IEnumerator EnemyRespawn(int level) { if (GameManager.Instance != null) { waveTable = null; if (WaveTable.Instance != null && WaveTable.Instance.FindTable(level, out waveTable)) { BossTable.TableRow bossTable = null; if (BossTable.Instance != null && BossTable.Instance.FindTable(waveTable.bossID, out bossTable)) { GameManager.Instance.MakeBoss(bossTable); } float spawnTime = waveTable.waveTime + Time.realtimeSinceStartup; while (spawnTime >= Time.realtimeSinceStartup) { if (GameManager.Instance.GetGameStatus.isGameStart == false) { yield break; } EnemyTable.TableRow enemyTable = null; if (EnemyTable.Instance != null && EnemyTable.Instance.FindTable(waveTable.GetRandomSelectMonsterID(), out enemyTable)) { GameManager.Instance.MakeEnemy(enemyTable, Random.Range(0, GameManager.MAX_ENEMY_LANE_COUNT)); } yield return(new WaitForSeconds(waveTable.createTime)); } } else { GameManager.Instance.GetGameStatus.GameOver(); yield break; } GameManager.Instance.GetGameStatus.AddGem(waveTable.rewardValue); StartCoroutine("EnemyRespawn", GameManager.Instance.GetGameStatus.AddWave()); } }
public EnemyStatus(Enemy enemy, int level, EnemyTable.TableRow table) { this.enemy = enemy; this.enemyObj = enemy.transform; this.table = table; this.floorIndex = table.startFloor; this.level = level; this.maxHp = table.hp + level * table.hpAddValue; this.curHp = maxHp; this.damage = table.damage; this.moveSpeed = table.moveSpeed; this.killGold = table.killGold; this.buffList = new List <BuffParam>(); }
private void LoadEnemyCompleteCB(GameObject gameObj, System.Guid uid, params object[] param) { if (gameObj != null) { GameObject createObj = Instantiate(gameObj) as GameObject; createObj.transform.parent = rootPanelArray[(int)eRootPanelType.Type_InGame].transform; createObj.transform.localScale = gameObj.transform.localScale; Enemy enemy = createObj.GetComponent <Enemy>(); if (enemy != null) { int level = (int)param[0]; EnemyTable.TableRow table = (EnemyTable.TableRow)param[1]; enemy.Init(level, table); AddEnemyList(enemy); } } }
public EnemyStatus(Enemy enemy, EnemyTable.TableRow table) { this.enemy = enemy; this.table = table; }