예제 #1
0
        private void OnComponentAdded(Component cmp)
        {
            // Notify Components
            ICmpInitializable cmpInit = cmp as ICmpInitializable;

            if (cmpInit != null)
            {
                cmpInit.OnInit(Component.InitContext.AddToGameObject);
            }
            foreach (Component c in this.compList)
            {
                if (!c.Active || c == cmp)
                {
                    continue;
                }
                ICmpComponentListener cTemp = c as ICmpComponentListener;
                if (cTemp != null)
                {
                    cTemp.OnComponentAdded(cmp);
                }
            }

            // Public event
            if (this.eventComponentAdded != null)
            {
                this.eventComponentAdded(this, new ComponentEventArgs(cmp));
            }
        }
예제 #2
0
파일: Scene.cs 프로젝트: iidioter/jazz2
 private static void OnComponentAdded(ComponentEventArgs args)
 {
     if (args.Component.Active)
     {
         ICmpInitializable cInit = args.Component as ICmpInitializable;
         if (cInit != null)
         {
             cInit.OnInit(Component.InitContext.Activate);
         }
     }
     ComponentAdded?.Invoke(current, args);
 }
예제 #3
0
        private void OnComponentAdded(Component cmp)
        {
            // Notify Components
            ICmpInitializable cmpInit = cmp as ICmpInitializable;

            if (cmpInit != null)
            {
                cmpInit.OnInit(Component.InitContext.AddToGameObject);
            }

            // Public event
            this.eventComponentAdded?.Invoke(this, new ComponentEventArgs(cmp));
        }
예제 #4
0
 internal void OnActivate()
 {
     // Notify Components
     foreach (Component c in this.compList)
     {
         if (!c.ActiveSingle)
         {
             continue;
         }
         ICmpInitializable cInit = c as ICmpInitializable;
         if (cInit != null)
         {
             cInit.OnInit(Component.InitContext.Activate);
         }
     }
 }
예제 #5
0
        internal void OnSaved(bool deep = false)
        {
            // Notify Components
            foreach (Component c in this.compList)
            {
                ICmpInitializable cInit = c as ICmpInitializable;
                if (cInit != null)
                {
                    cInit.OnInit(Component.InitContext.Saved);
                }
            }

            if (deep && this.children != null)
            {
                foreach (GameObject c in this.children)
                {
                    c.OnSaved(deep);
                }
            }
        }