Color PathEntityDebugColorFromPathEntityType(PathEntityType type) { Color ret = new Color(); switch (type) { case PathEntityType.PATH_ENTITY_TYPE_EMPTY: ret = new Color(1, 1, 1, 1); break; case PathEntityType.PATH_ENTITY_TYPE_PLAYER: if (LevelCreatorEditor.Instance != null) { ret = LevelCreatorEditor.Instance.GetPlayerDebugColor(); } break; case PathEntityType.PATH_ENTITY_TYPE_BASE_ENEMY: if (LevelCreatorEditor.Instance != null) { ret = LevelCreatorEditor.Instance.GetBaseEnemyDebugColor(); } break; } return(ret); }
GameObject InstantiateEntityGoFromPathEntityType(PathEntityType type) { GameObject ret = null; switch (type) { case PathEntityType.PATH_ENTITY_TYPE_PLAYER: ret = Instantiate(LevelCreatorEditor.Instance.GetPlayerPrefab(), Vector3.zero, Quaternion.identity); EntityPlayer e_p = ret.AddComponent <EntityPlayer>(); e_p.Init(this); break; case PathEntityType.PATH_ENTITY_TYPE_BASE_ENEMY: ret = Instantiate(LevelCreatorEditor.Instance.GetBaseEnemyPrefab(), Vector3.zero, Quaternion.identity); EntityBaseEnemy e_b = ret.AddComponent <EntityBaseEnemy>(); e_b.Init(this); break; } return(ret); }
public List <GameEntity> GetGameEntitiesByEntityType(PathEntityType type) { List <GameEntity> ret = new List <GameEntity>(); for (int i = 0; i < path_points.Count; ++i) { PathPoint curr_tile = path_points[i]; if (curr_tile.entity.type == type) { if (curr_tile.entity.go != null) { GameEntity ge = curr_tile.entity.go.GetComponent <GameEntity>(); if (ge != null) { ret.Add(ge); } } } } return(ret); }
public GameEntity GetGameEntityByEntityType(PathEntityType type) { GameEntity ret = null; for (int i = 0; i < path_points.Count; ++i) { PathPoint curr_tile = path_points[i]; if (curr_tile.entity.type == type) { if (curr_tile.entity.go != null) { GameEntity ge = curr_tile.entity.go.GetComponent <GameEntity>(); if (ge != null) { ret = ge; } } } } return(ret); }