コード例 #1
0
        public void RemoveModule(ISCModule Module)
        {
            if (Module == null)
            {
                return;
            }

            DebugMy.Log("[HashCode: " + GetHashCode() + "] " + "Module '" + Module.GetType() + "' [HashCode: " + Module.GetHashCode() + "] Remove From Module '" + GetType(), this);
            lock (subModuleList) {
                subModuleList.Remove(Module);
            }

            Module.ModuleDestroy();
            Module.FatherModule = null;
        }
コード例 #2
0
        /// <summary>
        /// ModuleDestroy ===================================
        /// </summary>



        public void AddModule(ISCModule Module, bool isEffectGameObject = true, SCModulePriority priority = SCModulePriority.Middle)
        {
            if (Module == null)
            {
                return;
            }

            Module.FatherModule = this;
            Module.ModuleInit(isEffectGameObject, priority);

            DebugMy.Log("[HashCode: " + GetHashCode() + "] " + "Module '" + Module.GetType() + "' [HashCode: " + Module.GetHashCode() + "] Add To Module '" + GetType(), this);
            lock (subModuleList) {
                subModuleList.Add(Module);
            }
        }
コード例 #3
0
 public T Transition <T>(ISCModule data) where T : class
 {
     if ((data as T) == null)
     {
         throw new ArgumentException(String.Format("Invalid type: {0} passed to event expecting {1}", data.GetType(), typeof(T)));
     }
     return(data as T);
 }