示例#1
0
 public static void Test2()
 {
     int[][] grids =
         new AStarMapPath(StdioUtil.ReadTextFile("E:/WorkSpace/Unity/Test/Assets/tile/tileSet/fff.txt"))
         .grids;
     LogCat.log(grids);
 }
示例#2
0
        public static Action Test_GetNearestPoint()
        {
            Vector2Int point = AStarUtil.GetNearestPoint(new AStarMapPath(grids), new Vector2Int(0, 0),
                                                         new Vector2Int(3, 3)
                                                         , AStarMapPathConst.Critter_Can_Pass_Obstacle_Types, AStarMapPathConst.User_Can_Pass_Terrain_Types);

            LogCat.log(point);
            return(() => { AStarUtil.GUIShowPointList(0, 0, 9, 9, point); });
        }
示例#3
0
 public static void Test_CanPass2()
 {
     LogCat.log(AStarUtil.CanPass(new AStarMapPath(grids), new List <Vector2Int>
     {
         new Vector2Int(1, 1),
         new Vector2Int(2, 2),
         new Vector2Int(3, 3)
     }, AStarMapPathConst.Critter_Can_Pass_Obstacle_Types, AStarMapPathConst.User_Can_Pass_Terrain_Types));
 }
示例#4
0
 public void RemoveAssetBundleCat(AssetBundleCat assetBundleCat)
 {
     if (assetBundleCat == null)
     {
         return;
     }
     LogCat.log(assetBundleCat.assetBundleName + " removed");
     assetBundleCat.Get()?.Unload(true);            //最关键的一步
     assetBundleCatDict.RemoveByFunc((key, value) => value == assetBundleCat);
 }
示例#5
0
文件: Main.cs 项目: uiopsczc/Test
        IEnumerator DOIE()
        {
            LogCat.log(1);
            yield return(new WaitForSeconds(5));

            LogCat.log(2);
            yield return(new WaitForSeconds(5));

            LogCat.log(3);
        }
示例#6
0
文件: RoleTest.cs 项目: uiopsczc/Test
        public static void Test()
        {
            User user = Client.instance.user;

            user.AddRole("1");

            var dict    = new Hashtable();
            var dictTmp = new Hashtable();

            user.DoSave(dict, dictTmp);
            LogCat.log(dict, dictTmp);
        }
示例#7
0
        public static void Test1()
        {
            User user = Client.instance.user;

            user.AcceptMission("1", user);

            var dict    = new Hashtable();
            var dictTmp = new Hashtable();

            user.DoSave(dict, dictTmp);
            LogCat.log(dict, dictTmp);
        }
示例#8
0
        public void Save()
        {
            refIdHashtable.Clear();
            Hashtable dict = new Hashtable();

            dict["child_list"] = GetSave_ChildList(this.transform);
            string content  = MiniJson.JsonEncode(dict);
            string filePath = textAsset.GetAssetPath().WithRootPath(FilePathConst.ProjectPath);

            StdioUtil.WriteTextFile(filePath, content);
            AssetPathRefManager.instance.Save();
            AssetDatabase.Refresh();
            LogCat.log("保存完成");
        }
示例#9
0
        public static void Test()
        {
            User user = Client.instance.user;

            user.AddItems("4", 4);
            user.UseItem("4", user.mainRole);
            //    Client.instance.user.DealItems(new Dictionary<string, string>() { { "4", "4" }, { "5", "5\"hhhhhp:6\"" } });

            var dict     = new Hashtable();
            var dict_tmp = new Hashtable();

            user.DoSave(dict, dict_tmp);
            LogCat.log(dict, dict_tmp);
        }
示例#10
0
        public static void Test()
        {
            DoerAttrSetter doerAttrSetter = new DoerAttrSetter(null, new DoerAttrParser(Client.instance.user));
            var            result         = "";
            //    doerAttrSetter.Set("u.hp","{eval(4+5)}",false);


            var dict     = new Hashtable();
            var dict_tmp = new Hashtable();

            Client.instance.user.DoSave(dict, dict_tmp);
            LogCat.log(dict, dict_tmp);
            //    LogCat.log(result);
        }
示例#11
0
        public override void Start()
        {
            base.Start();
            LogCat.log("=============== Combat:Start ===============");
            this.time       = 0;
            this.isFinished = false;
            this.fixedUpdateRemainDuration = CombatConst.Fixed_Update_Duration;
            this.isStarted = true;
            var gameLevelClass =
                TypeUtil.GetType(argDict.GetOrGetDefault2 <string>("gameLevel_class_path",
                                                                   () => typeof(GameLevelBase).ToString()));

            this.gameLevel = this.AddChild(null, gameLevelClass) as GameLevelBase;
            this.gameLevel.Start();
        }
示例#12
0
 public void DoPaintPressed(TileMap tileMap, Vector2 local_pos, EventModifiers modifiers = default(EventModifiers))
 {
     LogCat.log(string.Format("DoPaintPressed ({0},{1})", TileMapUtil.GetGridX(tileMap, local_pos), TileMapUtil.GetGridY(tileMap, local_pos)));
     if (paint_mode == TileSetBrushPaintMode.Pencil)
     {
         Paint(tileMap, local_pos);
     }
     else
     {
         pressed_position = local_pos;
         is_dragging      = true;
         offset           = Vector2.zero;
         brushPattern     = GetBrushPattern();
     }
 }
示例#13
0
        public static void Test()
        {
            User user = Client.instance.user;

            user.AddItems("5", 5);
            user.AddItems("6", 6);
            user.PutOnEquip("5", user.mainRole);
            user.PutOnEquip("6", user.mainRole);

            var dict     = new Hashtable();
            var dict_tmp = new Hashtable();

            user.DoSave(dict, dict_tmp);
            LogCat.log(dict, dict_tmp);
        }
示例#14
0
        public static void Test()
        {
            User user = Client.instance.user;

            user.AddItems("5", 5);
            user.AddItems("6", 6);
            user.PutOnEquip("6", user.mainRole);
            user.EmbedOn(user.mainRole.GetEquipOfTypes("装备", "武器"), "5");
            //    user.EmbedOff(user.main_role.GetEquipOfTypes("装备", "武器"), "5");

            var dict    = new Hashtable();
            var dictTmp = new Hashtable();

            user.DoSave(dict, dictTmp);
            LogCat.log(dict, dictTmp);
        }
示例#15
0
        public void OnToolSelected(GUIToolbar guiToolbar, int selectedIndex, int preSelectedIndex)
        {
            switch (selectedIndex)
            {
            case 0:                     //对应button_guiContent_list的"A"
                LogCat.log("A");
                break;

            case 1:                     //对应button_guiContent_list的"B"
                LogCat.log("B");
                break;

            case 2:                     //对应button_guiContent_list的"C"
                LogCat.log("C");
                break;

            case 3:                     //对应button_guiContent_list的"D"
                LogCat.log("D");
                break;
            }
        }
示例#16
0
        public static void Test()
        {
            TestProto testProto = new TestProto();

            testProto.Account    = "aaa";
            testProto.Password   = "******";
            testProto.Dict["aa"] = "cc";
            testProto.Adresses.Add("abc");
            testProto.Adresses.Add("efg");
            testProto.TestSubProto         = new TestSubProto();
            testProto.TestSubProto.Account = "uiop";
            //      LogCat.log(testProto);
            //序列化
            byte[] data_bytes = testProto.Serialize();

            //反序列化
            TestProto obj = data_bytes.Deserialize <TestProto>();

            LogCat.log(obj.Dict["aa"]);
            LogCat.log(obj.TestSubProto.Account);
        }
示例#17
0
        public static string ExportUIText()
        {
            var filePath      = FilePathConst.ProjectPath + "py_tools/lang/excel/ui_string.xlsx";
            var checkPath     = "Assets/Resources/";         //检测的路径
            var allAssetPaths = AssetDatabase.GetAllAssetPaths();

            var allStringList = new List <string>();

            foreach (var path in allAssetPaths)
            {
                if (!path.StartsWith(checkPath))
                {
                    continue;
                }
                if (!path.EndsWith(".prefab"))
                {
                    continue;
                }
                var obj     = AssetDatabase.LoadAssetAtPath <GameObject>(path);
                var uiLangs = obj.GetComponentsInChildren <UILang>(true);
                foreach (var uiLang in uiLangs)
                {
                    var langId = uiLang.langId;
                    if (IsAllExcludeChars(langId))
                    {
                        continue;
                    }
                    allStringList.Add(langId);
                }
            }

            allStringList.Unique();             //去重
            StdioUtil.RemoveFiles(filePath);
            WriteToExcel(filePath, allStringList);
            LogCat.log("UI上的Text已经输出到", filePath);
            return(filePath);
        }
示例#18
0
 public static void Test_IsInRange()
 {
     LogCat.log(AStarUtil.IsInRange(grids, new Vector2Int(4, 5)));
 }
示例#19
0
 public static void Test_IsInRangeX()
 {
     LogCat.log(AStarUtil.IsInRangeX(grids, 6));
 }
示例#20
0
 public static void T1()
 {
     LogCat.log("t1");
 }
示例#21
0
 public static void T2()
 {
     LogCat.log("t2");
 }
示例#22
0
 public static void Test_IsNeighborBlock()
 {
     LogCat.log(AStarUtil.IsNeighborBlock(new Vector2Int(2, 2), new Vector2Int(2, 3)));
 }
示例#23
0
 public static void Test_IsValidObstacleType()
 {
     LogCat.log(AStarUtil.IsValidObstacleType(255));
 }
示例#24
0
 public static void Test_IsSameField()
 {
     LogCat.log(AStarUtil.IsSameField((int)Math.Pow(2, 9), (int)Math.Pow(2, 8)));
 }
示例#25
0
 public static void Test_GetBlockPoint()
 {
     LogCat.log(AStarUtil.GetBlockPoint(new Vector2Int(4, 7)));
 }
示例#26
0
 public static void Test_GetField()
 {
     LogCat.log(AStarUtil.GetField((int)Math.Pow(2, 9)));
 }
示例#27
0
 public static void Test_GetTerrainType()
 {
     LogCat.log(AStarUtil.GetTerrainType(24));
 }
示例#28
0
 public static void Test_GetObstacleType()
 {
     LogCat.log(AStarUtil.GetObstacleType(2));
 }
示例#29
0
 public static void Test_ToGridType()
 {
     LogCat.log(AStarUtil.GetObstacleType(AStarUtil.ToGridType(1, 1, 2)));
 }
示例#30
0
 public static void AbortAllThreads()
 {
     ThreadManager.instance.Abort();
     LogCat.log("退出所有线程完成");
 }