public void RemoveLevel(LevelBase level) { if (level != null && FindLevel(level) != null) { DetachChild(level); } }
public void AddLevel(LevelBase level) { if (level != null && FindLevel(level) == null) { AttachChild(level); } }
public override void OnStartLevel() { int childCount = GetNumChildren(); for (int i = 0; i < childCount; ++i) { LevelBase level = GetChild(i) as LevelBase; if (level != null) { level.OnStartLevel(); } } }
public LevelBase FindLevel(eNodeStorageType eNodeStorage) { for (int i = 0; i < children.Count; i++) { if (children[i] is LevelBase) { LevelBase childrenLevel = children[i] as LevelBase; if (childrenLevel.StorageType == eNodeStorage) { return(childrenLevel); } } } return(null); }
private LevelBase FindLevel(LevelBase level) { for (int i = 0; i < children.Count; i++) { if (children[i] is LevelBase) { LevelBase childrenLevel = children[i] as LevelBase; if (childrenLevel == level) { return(childrenLevel); } } } return(null); }