コード例 #1
0
 /// <summary>
 /// 测试经验
 /// </summary>
 public void TestLvExp()
 {
     for (int i = 0; i < 100; ++i)
     {
         CLog.Info("Lv:{0},{1}", i, SetMaxExp(i));
     }
 }
コード例 #2
0
ファイル: BuildWindow.cs プロジェクト: chengyimingvb/CYMUni
 void RefreshData()
 {
     titleContent.text     = "Build";
     TitleStyle.fixedWidth = 100;
     EnsureProjectFiles();
     RefreshSceneNames();
     Repaint();
     if (DLCConfig.Ins != null &&
         BuildConfig.Ins != null &&
         LocalConfig.Ins != null &&
         GameConfig.Ins != null &&
         CursorConfig.Ins != null &&
         UIConfig.Ins != null &&
         ImportConfig.Ins != null &&
         LogConfig.Ins != null
         )
     {
         CLog.Info("创建所有的Config成功!!!");
     }
     else
     {
         CLog.Error("有Config没有创建成功");
     }
     CLog.Info("打开开发者界面");
 }
コード例 #3
0
ファイル: Dirtyword.cs プロジェクト: chengyimingvb/CYMUni
        /// <summary>
        /// 加载内存词库
        /// </summary>
        public static void Load(HashSet <string> words)
        {
            List <string> wordList = new List <string>();

            Array.Clear(MEMORYLEXICON, 0, MEMORYLEXICON.Length);
            foreach (string word in words)
            {
                string key = ToDBC(word);
                wordList.Add(key);
            }
            for (int i = wordList.Count - 1; i > 0; i--)
            {
                if (wordList[i].ToString() == wordList[i - 1].ToString())
                {
                    wordList.RemoveAt(i);
                }
            }
            foreach (var word in wordList)
            {
                if (word.Length > 0)
                {
                    WordGroup group = MEMORYLEXICON[(int)word[0]];
                    if (group == null)
                    {
                        group = new WordGroup();
                        MEMORYLEXICON[(int)word[0]] = group;
                    }
                    group.Add(word.Substring(1));
                }
            }
            CLog.Info("加载脏词库成功");
        }
コード例 #4
0
ファイル: BaseBuildWindow.cs プロジェクト: mengtest/CYMCommon
        void RefreshData()
        {
            titleContent.text     = "开发界面";
            TitleStyle.fixedWidth = 100;

            RefreshSceneNames();
            CLog.Info("打开开发者界面");
        }
コード例 #5
0
        public override void Purchase()
        {
            string orderID = IDUtil.GenOrderNumber();
            string key     = GameConfig.Ins.SteamWebAPI;

            void SendUserInfo()
            {
                CLog.Info("开始发送");
                string str    = "key=" + key + "&steamid=" + GetUserID().ToString();
                var    result = HTTPUtil.CreateGetHttpResponse("https://partner.steam-api.com/ISteamMicroTxn/GetUserInfo/v2/?" + str, null);

                CLog.Info(result.ToString());
            }

            void GetUserInfo()
            {
                CLog.Info("开始发送");
                string str    = "key=" + key + "&steamid=" + GetUserID().ToString();
                var    result = HTTPUtil.CreateGetHttpResponse("https://partner.steam-api.com/ISteamMicroTxn/GetUserInfo/v2/" + str, null);

                CLog.Info(result.ToString());
            }

            void SendInitTxn()
            {
                Dictionary <string, string> dic = new Dictionary <string, string>();

                dic.Add("key", key);
                dic.Add("orderid", orderID.ToString());
                dic.Add("steamid", GetUserID().ToString());
                dic.Add("appid", GetAppId().ToString());
                dic.Add("itemcount", "1");
                dic.Add("language", GetCurLanguageStr());
                dic.Add("currency", "CNY");
                dic.Add("itemid[0]", IDUtil.GenString());
                dic.Add("qty[0]", "1");
                dic.Add("amount[0]", "100");
                dic.Add("description[0]", "此物品非常凶残");
                var result = HTTPUtil.CreatePostHttpResponse("https://partner.steam-api.com/ISteamMicroTxnSandbox/InitTxn/v3/", dic);

                CLog.Info(result.ToString());
            }

            void SendFinalizeTxn()
            {
                Dictionary <string, string> dic = new Dictionary <string, string>();

                dic.Add("key", key);
                dic.Add("orderid", orderID);
                dic.Add("appid", GetAppId().ToString());
                var result = HTTPUtil.CreatePostHttpResponse("https://partner.steam-api.com/ISteamMicroTxnSandbox/FinalizeTxn/v2/", dic);

                CLog.Info(result.ToString());
            }
        }
コード例 #6
0
ファイル: BaseBuildWindow.cs プロジェクト: mengtest/CYMCommon
 public static void ToolBuildAllConfig()
 {
     if (DLCConfig.Ins != null ||
         BuildConfig.Ins != null ||
         BuildLocalConfig.Ins != null ||
         GameConfig.Ins != null ||
         CursorConfig.Ins != null ||
         DLCConfig.Ins != null ||
         UIConfig.Ins != null
         )
     {
         CLog.Info("创建所有的Config成功!!!");
     }
 }
コード例 #7
0
        private void OnProcessCMDArgs()
        {
#if UNITY_EDITOR
            string[] commandLineArgs = Environment.GetCommandLineArgs();
            foreach (var item in commandLineArgs)
            {
                CommandLineArgs.Add(item);
                if (item == "-GM")
                {
                    DiffMgr.SetGMMod(true);
                }
                CLog.Info("CMDline arg:" + item);
            }
#endif
        }
コード例 #8
0
ファイル: BaseExcelMgr.cs プロジェクト: chengyimingvb/CYMUni
        private void LoadExcelData(byte[] buffer, string tableName)
        {
            CLog.Info("加载数据表:" + tableName);
            WorkBook book = new WorkBook(buffer);

            if (book == null || book.Count <= 0)
            {
                CLog.Error("错误!无法读取Excel:" + tableName);
            }
            foreach (var item in book)
            {
                if (!item.Name.StartsWith(Const.Prefix_Lang_Notes))
                {
                    OnConvert(item, tableName);
                }
            }
        }
コード例 #9
0
        IEnumerator IEnumerator_Load()
        {
            yield return(new WaitForEndOfFrame());

            Callback_OnStartLoad?.Invoke();
            for (int i = 0; i < loderList.Count; ++i)
            {
                LoadInfo  = loderList[i].GetLoadInfo();
                CurLoader = loderList[i];
                yield return(SelfMono.StartCoroutine(loderList[i].Load()));

                Percent = (i / (float)loderList.Count);
            }
            yield return(new WaitForEndOfFrame());

            Percent   = 1.0f;
            IsLoadEnd = true;
            Callback_OnLoadEnd?.Invoke(LoadEndType.Success, LoadInfo);
            Callback_OnAllLoadEnd1?.Invoke();
            Callback_OnAllLoadEnd2?.Invoke();
            CurLoader = null;
            CLog.Info("All loaded!!");
        }
コード例 #10
0
        public override void OnBeAdded(IMono mono)
        {
            base.OnBeAdded(mono);
            uint appId = GetAppId();

            // 使用try防止崩溃
            try
            {
                SteamClient.Init(appId);
            }
            catch (Exception e)
            {
                CLog.Info("Error starting steam client: {0}", e);
                SteamClient.Shutdown();
            }
            if (SteamClient.IsValid)
            {
                IsSDKInited = true;
            }
            else
            {
                SteamClient.Shutdown();
            }
        }
コード例 #11
0
 void OnTest()
 {
     Delay.Run(1, () => CLog.Info("Delay 测试成功"));
     SuperInvoke.Run(() => CLog.Info("SuperInvoke 测试成功"), 2);
 }
コード例 #12
0
ファイル: BaseChecker.cs プロジェクト: mengtest/CYMCommon
 public void AddInfo(string str)
 {
     CLog.Info(str);
     InfoStr += str + "\n";
 }
コード例 #13
0
ファイル: BaseBuildWindow.cs プロジェクト: mengtest/CYMCommon
        void Present_Main()
        {
            EditorGUILayout.BeginVertical(VerticalStyle);
            if (BuildLocalConfig.Ins.Fold_Present_Main = EditorGUILayout.Foldout(BuildLocalConfig.Ins.Fold_Present_Main, "构建", true))
            {
                BuildConfig.Platform     = (Platform)EditorGUILayout.Popup("目标", (int)BuildConfig.Platform, Enum.GetNames(typeof(Platform)));
                BuildConfig.Distribution = (Distribution)EditorGUILayout.EnumPopup("发布平台", BuildConfig.Distribution);
                EditorGUILayout.LabelField(string.Format("版本号预览:{0}", BuildConfig));
                EditorGUILayout.LabelField(string.Format("完整版本号预览:{0}", BuildConfig.FullVersionName));
                BuildConfig.Name     = EditorGUILayout.TextField("名称", BuildConfig.Name);
                BuildConfig.SubTitle = EditorGUILayout.TextField("副标题", BuildConfig.SubTitle);
                BuildConfig.Major    = EditorGUILayout.IntField("主版本", BuildConfig.Major);
                BuildConfig.Minor    = EditorGUILayout.IntField("副版本", BuildConfig.Minor);
                BuildConfig.Data     = EditorGUILayout.IntField("数据库版本", BuildConfig.Data);
                BuildConfig.Prefs    = EditorGUILayout.IntField("Prefs", BuildConfig.Prefs);

                EditorGUILayout.BeginHorizontal();
                BuildConfig.Tag    = (VersionTag)EditorGUILayout.EnumPopup("后缀", BuildConfig.Tag);
                BuildConfig.Suffix = EditorGUILayout.IntField(BuildConfig.Suffix);
                EditorGUILayout.EndHorizontal();

                BuildConfig.BuildType = (BuildType)EditorGUILayout.EnumPopup("打包版本", BuildConfig.BuildType);

                BuildConfig.IgnoreChecker = EditorGUILayout.Toggle("忽略检查", BuildConfig.IgnoreChecker);
                bool preDevelopmentBuild = BuildConfig.IsUnityDevelopmentBuild;
                BuildConfig.IsUnityDevelopmentBuild = EditorGUILayout.Toggle("UnityDevBuild", BuildConfig.IsUnityDevelopmentBuild);
                if (preDevelopmentBuild != BuildConfig.IsUnityDevelopmentBuild)
                {
                    EditorUserBuildSettings.development = BuildConfig.IsUnityDevelopmentBuild;
                }

                if (PlayerSettings.bundleVersion != BuildConfig.ToString())
                {
                    PlayerSettings.bundleVersion = BuildConfig.ToString();
                }


                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("构建Manifest"))
                {
                    Builder.BuildManifest(Native);
                }
                if (GUILayout.Button("构建AB"))
                {
                    Builder.BuildBundle(Native);
                }
                if (GUILayout.Button("构建EXE"))
                {
                    if (CheckEorr())
                    {
                        return;
                    }
                    if (!CheckDevBuildWarring())
                    {
                        return;
                    }
                    if (!CheckAuthority())
                    {
                        return;
                    }
                    Builder.BuildEXE();
                }
                if (GUILayout.Button("构建AB&EXE"))
                {
                    if (CheckEorr())
                    {
                        return;
                    }
                    if (!CheckDevBuildWarring())
                    {
                        return;
                    }
                    if (!CheckAuthority())
                    {
                        return;
                    }
                    Builder.BuildBundleAndEXE(Native);
                }
                EditorGUILayout.EndHorizontal();


                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("运行游戏"))
                {
                    BaseFileUtils.OpenFile(BuildConfig.ExePath);
                    CLog.Info("Run:{0}", BuildConfig.ExePath);
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
        }
コード例 #14
0
ファイル: BuildWindow.cs プロジェクト: chengyimingvb/CYMUni
 protected static bool CheckAuthority()
 {
     CLog.Info("打包:" + SystemInfo.deviceName);
     return(true);
 }
コード例 #15
0
ファイル: BuildWindow.cs プロジェクト: chengyimingvb/CYMUni
        void Present_Build()
        {
            EditorGUILayout.BeginVertical(VerticalStyle);
            if (LocalConfig.FoldDLC = EditorGUILayout.Foldout(LocalConfig.FoldDLC, "构建", true))
            {
                EditorGUILayout.BeginVertical();

                foreach (var item in DLCConfig.EditorAll)
                {
                    EditorGUILayout.BeginHorizontal();

                    EditorGUILayout.LabelField(item.Name, GUILayout.MaxWidth(100));

                    if (DLCConfig.IsSimulationEditor)
                    {
                        if (GUILayout.Button("Build Config"))
                        {
                            Builder.BuildDLCConfig(item);
                            AssetDatabase.Refresh();
                        }
                        if (GUILayout.Button("Build Bundle"))
                        {
                            Builder.BuildBundle(item);
                            EditorUtility.DisplayDialog("提示!", "恭喜! 已经打包完成!!", "确定");
                        }
                    }
                    else
                    {
                        EditorGUILayout.LabelField("请勾选编辑器模式");
                    }

                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical();
                if (GUILayout.Button("RrfreshDLC"))
                {
                    DLCConfig.RefreshDLC();
                }
                if (GUILayout.Button("RecreateDLC"))
                {
                    DLCConfig.RecreateDLC();
                    DLCConfig.RefreshDLC();
                }
                if (DLCConfig.IsSimulationEditor)
                {
                    if (GUILayout.Button("One click build"))
                    {
                        if (CheckEorr())
                        {
                            return;
                        }
                        if (!CheckDevBuildWarring())
                        {
                            return;
                        }
                        if (!CheckAuthority())
                        {
                            return;
                        }
                        RefreshData();
                        foreach (var item in DLCConfig.EditorAll)
                        {
                            Builder.BuildBundle(item);
                        }
                        Builder.BuildEXE();
                        EditorUtility.DisplayDialog("提示!", "恭喜! 已经打包完成!!", "确定");
                        EditorApplication.Beep();
                    }
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("Build"))
                {
                    if (CheckEorr())
                    {
                        return;
                    }
                    if (!CheckDevBuildWarring())
                    {
                        return;
                    }
                    if (!CheckAuthority())
                    {
                        return;
                    }
                    RefreshData();
                    Builder.BuildEXE();
                    EditorUtility.DisplayDialog("提示!", "恭喜! 已经打包完成!!", "确定");
                }

                if (GUILayout.Button("Run game"))
                {
                    FileUtil.OpenFile(BuildConfig.ExePath);
                    CLog.Info("Run:{0}", BuildConfig.ExePath);
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
        }