public void SetMonsterStat(MonsterTb monsterData) { id = monsterData.id; maxHp = monsterData.hp; moveSpeed = monsterData.moveSpeed; name = monsterData.name; targetType = monsterData.targetType; monsterPoint = monsterData.monsterPoint; hp = maxHp; }
private void MonsterLevelSet(Monster target) { MonsterTb copyData = ExtensionMethod.GetMonsterTb((MonsterId)currentRound); target.maxHp = copyData.hp; target.hp = copyData.hp; target.id = copyData.id; target.name = copyData.name; target.moveSpeed = copyData.moveSpeed; target.targetType = copyData.targetType; target.monsterPoint = copyData.monsterPoint; ExtensionMethod.MonsterSpriteChange(copyData.name, target.monsterSprite); if (target.isDie == true) { target.isDie = false; } Vector3Int startPosition = GridTile.Ins.GetStartPosition(); target.transform.position = GridTile.Ins.pathfinder.nodeGroup.GetPosition(startPosition.x, startPosition.y); target.move.SetMove(GridTile.Ins.SetMovePath().ToArray(), 0); }
public bool Download() { if (m_TbWWW == null) { m_TbWWW = _instance.gameObject.AddComponent <TableWWW>(); } if (m_mapDownloadList.Count == 0 || (m_mapDownloadList.Count + 1) != m_nSuccessCount) { m_mapDownloadList.Clear(); AddTable <TbDataIO <TowerTb> >(eTable.Tower, (a_bSuccess) => { ++m_nDownloadCount; if (a_bSuccess == true) { Debug.LogError("success"); ++m_nSuccessCount; var li = TbDataIO <TowerTb> .m_liTb; for (int i = 0; i < li.Count; ++i) { Table <string, TowerTb> .SetTb(li[i].towerName, li[i]); } } } , (strReadLine) => { TowerTb towerBase = new TowerTb(strReadLine.Split(',')); Table <string, TowerTb> .SetTb(towerBase.towerName, towerBase); } ); //SpawnTowerTb AddTable <TbDataIO <SpawnTowerTb> >(eTable.SpawnTower, (a_bSuccess) => { ++m_nDownloadCount; if (a_bSuccess == true) { Debug.LogError("success"); ++m_nSuccessCount; var li = TbDataIO <SpawnTowerTb> .m_liTb; for (int i = 0; i < li.Count; ++i) { Table <int, SpawnTowerTb> .SetTb(li[i].upgradeLevel, li[i]); } } }, (strReadLine) => { SpawnTowerTb spawnBase = new SpawnTowerTb(strReadLine.Split(',')); Table <int, SpawnTowerTb> .SetTb(spawnBase.upgradeLevel, spawnBase); }); //MonsterTable AddTable <TbDataIO <MonsterTb> >(eTable.Monster, (a_bSuccess) => { ++m_nDownloadCount; if (a_bSuccess == true) { Debug.LogError("success"); ++m_nSuccessCount; var li = TbDataIO <MonsterTb> .m_liTb; for (int i = 0; i < li.Count; ++i) { Table <MonsterId, MonsterTb> .SetTb(li[i].id, li[i]); } } }, (strReadLine) => { MonsterTb monsterBase = new MonsterTb(strReadLine.Split(',')); Table <MonsterId, MonsterTb> .SetTb((MonsterId)monsterBase.id, monsterBase); }); // Download Start ---------------------------------------------------------------- StartCoroutine(Down()); return(true); } return(false); }