Ejemplo n.º 1
0
        public static SCKeyboardBase Open(SCKeyboardEnum sckeyboardEnum, string text, TouchScreenKeyboardType touchScreenKeyboardType, Transform parent, Vector3 position, Quaternion rotation, Vector3 scale)
        {
            if (keyboardCacheDic.ContainsKey(parent))
            {
                Dictionary <SCKeyboardEnum, SCKeyboardBase> keyboardEnumDic = keyboardCacheDic[parent];
                if (keyboardEnumDic != null && keyboardEnumDic.ContainsKey(sckeyboardEnum))
                {
                    SCKeyboardBase keyboardCache = keyboardEnumDic[sckeyboardEnum];
                    keyboardCache.ResetKeyboard();
                    keyboardCache.SetKeyboardTransform(parent, position, rotation, scale);
                    return(keyboardCache);
                }
            }

            if (!keyboardTypeDic.ContainsKey(sckeyboardEnum))
            {
                DebugMy.LogError("This SCKeyboardEnum do not exist", sckeyboardEnum);
                return(null);
            }

            SCKeyboardBase keyboard = Activator.CreateInstance(keyboardTypeDic[sckeyboardEnum], parent, position, rotation, scale) as SCKeyboardBase;

            if (!keyboardCacheDic.ContainsKey(parent))
            {
                keyboardCacheDic[parent] = new Dictionary <SCKeyboardEnum, SCKeyboardBase>();
            }
            keyboardCacheDic[parent][sckeyboardEnum] = keyboard;
            return(keyboard);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Module 初始化 ===================================
        /// </summary>
        public void ModuleInit(bool isEffectGameObject = true, SCModulePriority priority = SCModulePriority.Middle)
        {
            if (IsModuleInit)
            {
                DebugMy.LogError("ModuleInit Had Invoke", this);
                return;
            }

            IsModuleInit = true;
            ModuleName   = GetType().ToString();
            IsMono       = false;

            IsEffectGameObject = isEffectGameObject;
            Priority           = priority;

            OnSCAwake();
        }