Esempio n. 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);
 }
Esempio n. 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); });
        }
Esempio n. 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));
 }
Esempio n. 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);
 }
Esempio n. 5
0
        IEnumerator DOIE()
        {
            LogCat.log(1);
            yield return(new WaitForSeconds(5));

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

            LogCat.log(3);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 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);
        }
Esempio n. 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("保存完成");
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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();
        }
Esempio n. 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();
     }
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
            }
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 18
0
 public static void Test_IsInRange()
 {
     LogCat.log(AStarUtil.IsInRange(grids, new Vector2Int(4, 5)));
 }
Esempio n. 19
0
 public static void Test_IsInRangeX()
 {
     LogCat.log(AStarUtil.IsInRangeX(grids, 6));
 }
Esempio n. 20
0
 public static void T1()
 {
     LogCat.log("t1");
 }
Esempio n. 21
0
 public static void T2()
 {
     LogCat.log("t2");
 }
Esempio n. 22
0
 public static void Test_IsNeighborBlock()
 {
     LogCat.log(AStarUtil.IsNeighborBlock(new Vector2Int(2, 2), new Vector2Int(2, 3)));
 }
Esempio n. 23
0
 public static void Test_IsValidObstacleType()
 {
     LogCat.log(AStarUtil.IsValidObstacleType(255));
 }
Esempio n. 24
0
 public static void Test_IsSameField()
 {
     LogCat.log(AStarUtil.IsSameField((int)Math.Pow(2, 9), (int)Math.Pow(2, 8)));
 }
Esempio n. 25
0
 public static void Test_GetBlockPoint()
 {
     LogCat.log(AStarUtil.GetBlockPoint(new Vector2Int(4, 7)));
 }
Esempio n. 26
0
 public static void Test_GetField()
 {
     LogCat.log(AStarUtil.GetField((int)Math.Pow(2, 9)));
 }
Esempio n. 27
0
 public static void Test_GetTerrainType()
 {
     LogCat.log(AStarUtil.GetTerrainType(24));
 }
Esempio n. 28
0
 public static void Test_GetObstacleType()
 {
     LogCat.log(AStarUtil.GetObstacleType(2));
 }
Esempio n. 29
0
 public static void Test_ToGridType()
 {
     LogCat.log(AStarUtil.GetObstacleType(AStarUtil.ToGridType(1, 1, 2)));
 }
Esempio n. 30
0
 public static void AbortAllThreads()
 {
     ThreadManager.instance.Abort();
     LogCat.log("退出所有线程完成");
 }