Пример #1
0
        /// 创建新的monoController
        MonoController CreateMonoController()
        {
            ++monoControllerCount;
            GameObject go = new GameObject("MonoController" + "_Num_" + monoControllerCount);

            go.transform.SetParent(ModuleMountObject.transform);
            //MonoController mc = go.AddComponent<MonoController>();
            MonoController mc = Utility.Add <MonoController>(go);

            mc.MonoID = monoControllerCount;
            Register(monoControllerCount, mc);
            return(mc);
        }
Пример #2
0
        /// <summary>
        /// 返回第一个符合条件的对象的ID,否则返回-1
        /// </summary>
        /// <param name="type"></param>
        /// <param name="currentIndex"></param>
        short  FindUseable(UpdateType type)
        {
            short id = -1;

            foreach (var mc in monoMap.Values)
            {
                MonoController monoc = mc as MonoController;
                id = monoc.UseableMono(type);
                if (id != -1)
                {
                    return(id);
                }
            }
            return(id);
        }