public void initialize(MapCreepData creepData) { m_creepData = creepData; transform.position = new Vector3(m_creepData.position.x, 0.0f, m_creepData.position.y); initialize(new CharacterData(CharacterConfigDBHelper.getCreepConfig(m_creepData.type, m_creepData.level))); updateVisual(); isInit = true; }
public void initialize(Vector2 position, int team, GameData.HeroType type, bool isPlayer = false) { m_type = type; m_team = team; transform.position = new Vector3(position.x, 0.0f, position.y); initialize(new CharacterData(CharacterConfigDBHelper.getHeroConfig(type, 1))); var gameController = FindObjectOfType <GameController>(); this.OnDeath += gameController.onPlayerDeath; updateVisual(); if (isPlayer) { gameObject.AddComponent <Player>(); } }