Example #1
0
 public override void Awake()
 {
     base.Awake();
     TitleLabel.text = "框架入门";
     HFLog.C("页面初始化完成");
     IsNeedUpdate = true;
 }
Example #2
0
 public override void OnShowAnimation()
 {
     base.OnShowAnimation();
     transform.localScale = Vector3.zero;
     transform.DOScale(Vector3.one, 1).OnComplete(OnShow);
     HFLog.C("播放打开动画");
 }
Example #3
0
 public static void OpenDirectory(string path)
 {
     if (!string.IsNullOrEmpty(path))
     {
         HFLog.C(path);
         System.Diagnostics.Process.Start("explorer.exe", path);
     }
 }
Example #4
0
 private static void m_CheckCircularReference(CircularReferenceSet set, AssetBundleManifest manifest)
 {
     HFLog.C("--------------------------------------");
     HFLog.C("开始检测 " + set.name);
     string[] str = manifest.GetAllDependencies(set.name);
     foreach (var item in str)
     {
         m_CheckCircularReference(set, item, manifest);
     }
     HFLog.C("检测完成√ " + set.name);
 }
Example #5
0
 private void Awake()
 {
     foreach (Type type in typeof(Game).Assembly.GetTypes())
     {
         object[] attrs = type.GetCustomAttributes(typeof(TestAttribute), false);
         foreach (object attr in attrs)
         {
             HFLog.C(attr.GetType());
             XXX x = (XXX)Activator.CreateInstance(type);
             x.Test();
         }
     }
 }
Example #6
0
        public static string[] GetBuildScenes()
        {
            List <string> names = new List <string>();

            foreach (EditorBuildSettingsScene e in EditorBuildSettings.scenes)
            {
                if (e != null && e.enabled)
                {
                    HFLog.C(e.path);
                    names.Add(e.path);
                }
            }
            return(names.ToArray());
        }
Example #7
0
        public static BuildTarget GetBuildTarget()
        {
            BuildTarget target = BuildTarget.NoTarget;

#if UNITY_STANDALONE_WIN
            target = BuildTarget.StandaloneWindows;
#elif UNITY_STANDALONE_OSX
            target = BuildTarget.StandaloneOSXIntel;
#elif UNITY_IPHONE
            target = BuildTarget.iOS;
#elif UNITY_ANDROID
            target = BuildTarget.Android;
#endif
            HFLog.C("目标平台 " + target);
            return(target);
        }
Example #8
0
        public async void 局部刷新Task()
        {
            HFLog.C("开始局部刷新task");
            LambdaUpdateTask task = GameFactory.CreateEntity <LambdaUpdateTask>();
            int a = 0;
            await task.Wait(delegate(LambdaUpdateTask t, object o)
            {
                a += (int)o;
                HFLog.C("局部刷新task " + a);
                if (a >= 100)
                {
                    t.CompleteTask();
                }
            }, new UniTaskCompletionSource(), 1);

            HFLog.C("完成局部刷新task");
        }
Example #9
0
        private static void m_CheckCircularReference(CircularReferenceSet set, string name, AssetBundleManifest manifest)
        {
            if (set.Contains(name))
            {
                HFLog.E("循环引用 " + set.name + "   " + name);
                return;
            }

            HFLog.C("检测中 " + set.name + "  " + name);

            set.Add(name);

            string[] str = manifest.GetAllDependencies(name);
            foreach (var item in str)
            {
                m_CheckCircularReference(set, item, manifest);
            }
        }
Example #10
0
        static EditorRefresh()
        {
            HFLog.C("编辑器工具刷新");
            EnvironmentConfig environmentConfig = AssetDatabase.LoadAssetAtPath <EnvironmentConfig>(GameConst.EnvironmentConfigPath);

            if (environmentConfig == null)
            {
                environmentConfig = ScriptableObject.CreateInstance <EnvironmentConfig>();
                AssetDatabase.CreateAsset(environmentConfig, GameConst.EnvironmentConfigPath);
                environmentConfig.Refresh();
            }

            BuildConfig buildConfig = AssetDatabase.LoadAssetAtPath <BuildConfig>(GameConst.BuildConfigPath);

            if (buildConfig == null)
            {
                buildConfig = ScriptableObject.CreateInstance <BuildConfig>();
                AssetDatabase.CreateAsset(buildConfig, GameConst.BuildConfigPath);
                buildConfig.Refresh();
            }
        }
Example #11
0
        /// <summary>
        ///  销毁BaseElement 重载方法
        /// </summary>
        public virtual void Destroy()
        {
            if (IsDisposed)
            {
                HFLog.E("Entity 重复销毁 Id " + instanceId);
                return;
            }

            for (int i = components.Count - 1; i >= 0; i--)
            {
                Component Component = components[i];
                components.RemoveAt(i);
                Component.OnDestroy();
            }

            for (int i = childs.Count - 1; i >= 0; i--)
            {
                Entity child = childs[i];
                childs.RemoveAt(i);
                child.Destroy();
            }

            parent = null;

            foreach (var item in messageTypeSet)
            {
                NotificationCenter.Instance.RemoveObserver(this, item);
            }
            messageTypeSet.Clear();

            IsNeedUpdate      = false;
            IsNeedFixedUpdate = false;
            IsNeedLateUpdate  = false;

            DestoryGameObject();

            instanceId = 0;
        }
Example #12
0
 public static void Test(string a, string b, string c)
 {
     HFLog.C("a " + a);
     HFLog.C("b " + b);
     HFLog.C("c " + c);
 }
Example #13
0
 public void ProgressCallback1(float f)
 {
     HFLog.C("总进度  " + f);
 }
Example #14
0
        public async override void OnShow()
        {
            base.OnShow();
            HFLog.C("页面完全显示");
            HFFramework.HotFixManager.Instance.ExecuteHotFix("hotfixdll", "HotFix");

            /*
             * AssetManager.Instance.RefCount();
             *
             * AssetManager.Instance.GetSprite("texture", "123");
             *
             * AssetManager.Instance.RefCount();
             * AssetManager.Instance.UnloadUnusedAssetBundle();
             *
             * Material mat = AssetManager.Instance.GetAsset<Material>("mat", "mat");
             * HFLog.C(mat);
             * mat.name = "12";
             *
             * AssetPackage ap = AssetManager.Instance.GetAssetBundle("mat");
             * Material mat1 =  ap.assetBundle.LoadAsset<Material>("mat");
             * HFLog.C(mat1);
             *
             * mat1 = GameObject.Instantiate(mat);
             *
             * HFLog.C(mat == mat1);
             * HFLog.C(mat1.name);
             *
             * GameObject g = GameObject.CreatePrimitive(PrimitiveType.Cube);
             * g.GetComponent<MeshRenderer>().material = mat;
             * mat.color = Color.red;
             *
             * GameObject g1 = GameObject.CreatePrimitive(PrimitiveType.Sphere);
             * g1.GetComponent<MeshRenderer>().material = mat1;
             */


            //AssetManager.Instance.GetAssetAsync<Sprite>("texture", "123");


            //AssetManager.Instance.GetAssetAsync<Sprite>("texture", "123");

            /*
             * FileStream fs = new FileStream(Application.dataPath+ "/1.bin", FileMode.Create);
             * BinaryFormatter ff =  new BinaryFormatter();
             * ff.Serialize(fs, ConfigAddress.Instance);
             * fs.Close();
             *
             * fs = new FileStream(Application.dataPath + "/1.bin", FileMode.Open);
             * ff = new BinaryFormatter();
             * ConfigAddress ss = ff.Deserialize(fs) as ConfigAddress ;
             * Debug.Log(ss);
             *
             * await UIManager.Instance.Close<FunctionController>();
             * AssetManager.Instance.RefCount();
             * AssetManager.Instance.UnloadUnusedAssetBundle();
             */

            return;

            TimerManager.Schedule(1, 5, -1, delegate(Timer timer)
            {
                HFFramework.HotFixManager.Instance.executor.Invoke("HotFixEnter", "Test", null, "1", "2", "3");
            });

            DownLoader  loader   = DownLoadManager.Instance.GetDownLoader();
            string      url      = "http://182.48.99.226:18080/SharedFiles/Res/Assetbundles/Android_Assetbundles/ABVersion.Json";
            string      diskPath = PathManager.Instance.PersistentDataCustomPath + "/ABVersion.Json";
            UrlDiskPath path     = new UrlDiskPath(url, diskPath);

            loader.DownLoadFiles(new UrlDiskPath[] { path }, DownComp, ProgressCallback, Fail);
        }
Example #15
0
 public void PostProcessing()
 {
     HFLog.C("配置文件后处理");
 }
Example #16
0
 public void HPChanged(int value)
 {
     HFLog.C("血量: " + value);
 }
Example #17
0
 public void Test()
 {
     HFLog.C(this.GetType().Name);
 }
Example #18
0
 static void ReloadMethod()
 {
     HFLog.C("编辑器工具刷新方法");
 }