Пример #1
0
        private void OnComponentRemoving(ComponentCopy cmp)
        {
            // Notify Components
            ICmpAttachmentListener cmpInit = cmp as ICmpAttachmentListener;

            if (cmpInit != null)
            {
                cmpInit.OnRemoveFromGameObject();
            }

            // Public event
            if (this.eventComponentRemoving != null)
            {
                this.eventComponentRemoving(this, new ComponentCopyEventArgs(cmp));
            }
        }
Пример #2
0
        private void OnComponentAdded(ComponentCopy cmp)
        {
            // Notify Components
            ICmpAttachmentListener cmpInit = cmp as ICmpAttachmentListener;

            if (cmpInit != null)
            {
                cmpInit.OnAddToGameObject();
            }

            // Public event
            if (this.eventComponentAdded != null)
            {
                this.eventComponentAdded(this, new ComponentCopyEventArgs(cmp));
            }
        }