示例#1
0
 /// <summary>
 /// 组建被关联到伏组件的时候
 /// </summary>
 /// <param name="parentComponet"></param>
 protected virtual void OnBeAttachedToParentComponet(BaseCoreMgr parentComponet)
 {
     if (parentComponet.Mono != null)
     {
         OnBeAdded(parentComponet.Mono);
     }
 }
示例#2
0
        public virtual T AddComponent <T>() where T : BaseCoreMgr, new()
        {
            var component = BaseCoreMgr.Create <T>();

            componets.Add(component);
            if (component is IOnAnimTrigger)
            {
                triggersComponets.Add(component as IOnAnimTrigger);
            }
            if (component.NeedUpdate)
            {
                updateComponets.Add(component);
            }
            if (component.NeedLateUpdate)
            {
                lateUpdateComponets.Add(component);
            }
            if (component.NeedFixedUpdate)
            {
                fixedUpdateComponets.Add(component);
            }
            if (component.NeedGUI)
            {
                guiComponets.Add(component);
            }
            if (component.NeedGameLogicTurn)
            {
                needGameLogicTurnComponets.Add(component);
            }
            component.OnBeAdded(this);
            return((T)component);
        }
示例#3
0
 public virtual void RemoveComponent(BaseCoreMgr component)
 {
     if (component != null)
     {
         component.OnBeRemoved();
         if (component is IOnAnimTrigger)
         {
             triggersComponets.Remove(component as IOnAnimTrigger);
         }
         if (component.NeedUpdate)
         {
             updateComponets.Remove(component);
         }
         if (component.NeedLateUpdate)
         {
             lateUpdateComponets.Remove(component);
         }
         if (component.NeedFixedUpdate)
         {
             fixedUpdateComponets.Remove(component);
         }
         if (component.NeedGUI)
         {
             guiComponets.Remove(component);
         }
         componets.Remove(component);
     }
 }
示例#4
0
        public T AddSubComponent <T>() where T : BaseCoreMgr, new()
        {
            BaseCoreMgr component = Create <T>();

            subComponets.Add(component);
            component.IsSubComponent    = true;
            component.parentComponet    = this;
            component.NeedGameLogicTurn = true;
            component.OnBeAttachedToParentComponet(this);
            return((T)component);
        }
示例#5
0
 public virtual void Add(BaseCoreMgr ent)
 {
     Data.Add(ent.GetType(), ent);
 }