예제 #1
0
 public void RemoveLevel(LevelBase level)
 {
     if (level != null && FindLevel(level) != null)
     {
         DetachChild(level);
     }
 }
예제 #2
0
 public void AddLevel(LevelBase level)
 {
     if (level != null && FindLevel(level) == null)
     {
         AttachChild(level);
     }
 }
예제 #3
0
        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();
                }
            }
        }
예제 #4
0
 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);
 }
예제 #5
0
 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);
 }