예제 #1
0
    /// <summary>
    /// 打AB包
    /// </summary>
    /// <param name="options">打包选项</param>
    /// <param name="bt">打包类型</param>
    /// <param name="bIncrementalUpdate">是否增量打包,现在还没有什么用</param>
    public static void BuildAssetBundle(BuildAssetBundleOptions options, BuildTarget bt, bool bIncrementalUpdate = true)
    {
        ABSHInitAndSelect();

        //DateTimeString = DateTime.Now.ToString(VersionXmlInfo.DateFormat);
        VersionInfo.version = DateTime.Now;
        MyDic.ClearAllDic();
        ABDependenciesPositive.Clear();
        ABDependenciesReverse.Clear();
        RuntimePlatform runtimePlatform = AssetBundleSettingHelperEditor.BuildTargetToRuntimePlatform(bt);
        string          versionName     = ABSH.RuntimePlatformToSimplifyName(runtimePlatform);
        var             abpi            = ABSH.GetAssetBundleOutputPath(versionName);

        if (!bIncrementalUpdate)
        {
            //不进行增量更新,删除全部文件重新生成
            if (Directory.Exists(abpi.Dir_Relative))
            {
                Directory.Delete(abpi.Dir_Relative, true);
            }
        }
        else
        {
            //增量更新
            //这里并不需要做什么
        }
        if (!Directory.Exists(abpi.Dir_Relative))
        {
            Directory.CreateDirectory(abpi.Dir_Relative);
        }
        //在VersionInfo被覆盖前获得用来在下边做对比使用
        var lastVersionInfo = GetABVersionInfo(versionName);
        //获取所有需要打包的资源
        var buildMap = GetBuildMapByVersion(versionName);
        var manifest = BuildPipeline.BuildAssetBundles(abpi.Dir_Relative, buildMap, options, bt);

        if (manifest != null)
        {
            //生成新的versioninfo
            GenABVersionInfo(manifest, versionName);
            if (lastVersionInfo != null)
            {
                //其实这里的newAB和changedAB并不准备用来干什么,真正有用的只有delAB,这个需要把多余的AssetBundle文件和文件夹删除
                Dictionary <string, string> newAB;
                Dictionary <string, string> delAB;
                Dictionary <string, KeyValuePair <string, string> > changedAB;
                CompareOldInfoAndNewManifest(lastVersionInfo, manifest, versionName, out newAB, out delAB, out changedAB);
                if (delAB != null && delAB.Count > 0)
                {
                    DeleteAssetBundleFilesAndEmptyFolders(versionName, delAB);
                }
            }
            //生成依赖信息
            GenABDependenciesInfo(versionName);

            //最后把一些空的文件夹和新版本不需要的assetbundle
            AssetDatabase.Refresh();
        }
    }
예제 #2
0
        static void Main(string[] args)
        {
            Dictionary <int, string> Ogrenci = new Dictionary <int, string>();

            Ogrenci.Add(1, "sefa");
            Ogrenci.Add(2, "ali");
            int ogrenci_sayisi = Ogrenci.Count;

            Console.WriteLine(Ogrenci[1]);
            Console.WriteLine(ogrenci_sayisi);

            MyDic <int, String> Teacher = new MyDic <int, string>();

            Teacher.Add(5, "ali");

            Teacher.Add(5, "ali");
            int deneme = Teacher.Count;

            Console.WriteLine(deneme);
        }
예제 #3
0
        static void Main(string[] args)
        {
            var myMap = new MyDic <int, string>();

            myMap.Add(new Item <int, string>(1, "One"));
            myMap.Add(new Item <int, string>(2, "Two"));
            myMap.Add(new Item <int, string>(3, "Three"));
            myMap.Add(new Item <int, string>(4, "Four"));
            myMap.Add(new Item <int, string>(5, "Five"));
            foreach (var item in myMap)
            {
                Console.Write(item + " ");
            }
            Console.WriteLine();
            Console.WriteLine(myMap.Search(6) ?? "Not found");
            myMap.Remove(4);
            myMap.Remove(2);
            foreach (var item in myMap)
            {
                Console.Write(item + " ");
            }
            Console.WriteLine();

            var easyMap = new EasyMap <int, string>();

            easyMap.Add(new Item <int, string>(1, "One"));
            easyMap.Add(new Item <int, string>(2, "Two"));
            easyMap.Add(new Item <int, string>(3, "Three"));
            foreach (var item in easyMap)
            {
                Console.Write(item + " ");
            }
            Console.WriteLine();
            Console.WriteLine(easyMap.Search(5) ?? "Not found");
            Console.WriteLine(easyMap.Search(2) ?? "Not found");
            Console.ReadLine();
        }
예제 #4
0
파일: combo.cs 프로젝트: spall9/Fizz
    public static void Combo()
    {
        var target = TargetSelector.GetTarget(Spells.R.Range, DamageType.Magical);
        var use_r  = (Spells.R.IsReady() && Settings.combo_r);
        var use_e  = (Spells.E.IsReady() && Settings.combo_e);
        var use_w  = (Spells.W.IsReady() && Settings.combo_w);
        var use_q  = (Spells.Q.IsReady() && Settings.combo_q);

        if (target == null)
        {
            return;
        }
        if (use_q && Spells.Q.IsInRange(target))
        {
            Spells.Q.Cast(target);
        }
        if (MyDic.ContainsKey(target))
        {
            MyDic[target]++;
        }
        if (MyDic.ContainsKey(target) && MyDic[target] > Game.TicksPerSecond * 2 && Settings.combo_ww)
        {
            Spells.W.Cast();
        }
        else if (use_w && Spells.W.IsInRange(target) && !Settings.combo_ww)
        {
            Spells.W.Cast();
        }
        var prediction = Prediction.Position.PredictUnitPosition(target, 1).Distance(Player.Instance.Position)
                         <= (Spells.E.Range + 200 + 330);

        if (Spells.E.Name == "FizzE" && use_e && !Spells.Q.IsReady() && prediction)
        {
            var castPos = Player.Instance.Distance(Prediction.Position.PredictUnitPosition(target, 1)) > Spells.E.Range
                              ? Player.Instance.Position.Extend(
                Prediction.Position.PredictUnitPosition(target, 1),
                Spells.E.Range).To3DWorld()
                              : target.Position;

            Spells.E.Cast(castPos);

            var pred2 = Prediction.Position.PredictUnitPosition(target, 1).Distance(Player.Instance.Position)
                        <= (200 + 330 + target.BoundingRadius);

            if (pred2)
            {
                Player.IssueOrder(
                    GameObjectOrder.MoveTo,
                    Prediction.Position.PredictUnitPosition(target, 1).To3DWorld());
            }
            else
            {
                Spells.E.Cast(Prediction.Position.PredictUnitPosition(target, 1).To3DWorld());
            }
        }
        if (use_r && !target.IsZombie)
        {
            if (!target.IsFacing(Player.Instance))
            {
                if (Player.Instance.Distance(target.Position) < (Spells.R.Range - target.MoveSpeed) - (165))
                {
                    Spells.CastR(target, Settings.RMode);
                }
            }
            else
            {
                if (Player.Instance.Distance(target.Position) <= (Spells.R.Range))
                {
                    Spells.CastR(target, Settings.RMode);
                }
            }
        }
    }