示例#1
0
 private void OnDisable()
 {
     UIManager.Instance.DoDelay(0.00001f).OnComplete(() =>
     {
         valueMonitorPool.Update();
     });
 }
示例#2
0
 public virtual void Update()
 {
     if (valueMonitorPool != null)
     {
         valueMonitorPool.Update();
     }
 }
示例#3
0
        public override void OnInspectorGUI()
        {
            valueMonitorPool.Update();

            if (roleController)
            {
                if (Application.isPlaying)
                {
                    //if (roleController.SkeletonAnimator != null && roleController.SkeletonAnimator.HitPointList != null)
                    //{
                    //    if (hitPointStringList == null || hitPointStringList.Length != roleController.SkeletonAnimator.HitPointList.Count)
                    //    {
                    //        hitPointStringList = new string[roleController.SkeletonAnimator.HitPointList.Count];

                    //        for (int i = 0; i < hitPointStringList.Length; i++)
                    //        {
                    //            hitPointStringList[i] = i + "_" + roleController.SkeletonAnimator.HitPointList[i].hitType;
                    //        }
                    //    }

                    //    hitPointSelectedIndex = MyGUI.PopupWithTitle("打击点", hitPointSelectedIndex, hitPointStringList);
                    //}

                    //MyGUI.DamageDataField(damageData);

                    //if (MyGUI.Button("测试打击效果"))
                    //{
                    //    var hitPoint = roleController.SkeletonAnimator.HitPointList[hitPointSelectedIndex];

                    //    damageData.collideBounds = new Bounds(roleController.transform.TransformPoint(new Vector3(hitPoint.pos.x * roleController.GetDirectionInt(), hitPoint.pos.y, hitPoint.pos.z)), Vector3.zero);

                    //    //damageData.collideBounds = new Bounds(Vector3.zero, Vector3.zero);
                    //    roleController.OnHurt(damageData);
                    //}
                }
            }

            DrawDefaultInspector();
        }
示例#4
0
 private void Update()
 {
     valueMonitorPool.Update();
 }
示例#5
0
        void OnGUI()
        {
            if (MyGUI.Button(isEditing ? "编辑中" : "未编辑"))
            {
                isEditing = !isEditing;
            }

            // 当前编辑的场景 add by TangJian 2018/11/21 11:51
            {
                List <SceneController> sceneControllers = MapEditorManager.GetCurrSceneControllerList();
                string[] sceneOptions = new string[sceneControllers.Count];
                for (int i = 0; i < sceneControllers.Count; i++)
                {
                    sceneOptions[i] = sceneControllers[i].name;
                }
                currSelectedSceneIndex = MyGUI.PopupWithTitle("当前编辑场景", currSelectedSceneIndex, sceneOptions);

                if (sceneControllers.CanFindIndex(currSelectedSceneIndex))
                {
                    currSceneController = sceneControllers[currSelectedSceneIndex];
                }
            }

            if (MyGUI.Button("计算角度"))
            {
                // Camera camera = Camera.main;

                // Vector3 beginScreenVec3 = new Vector3(0, 0);
                // Vector3 endScreenVec3 = new Vector3(100, 100);

                // Vector3 endWorldVec3 = camera.ScreenToWorldPoint(endScreenVec3);
                Debug.Log(Mathf.Atan(2) / Mathf.PI * 180);
                Debug.Log(Mathf.Atan(Mathf.Sqrt(3)) / Mathf.PI * 180);

                // Debug.Log(Mathf.Atan(2) / Mathf.PI * 180);


                // Debug.Log();
            }

            gravity = MyGUI.FloatFieldWithTitle("gravity", gravity);

            if (MyGUI.Button("Test"))
            {
                var dict = Tools.GetFileListInFolder("Assets");

                List <string> retList = new List <string>();

                object suo = new object();

                retList.Clear();
                int begin = Tools.GetTimestamp();
                dict.AsParallel().ForAll(pair =>
                {
                    for (int i = 0; i < 100000; i++)
                    {
                    }
                });

                Debug.Log("duration1 = " + (Tools.GetTimestamp() - begin).ToString());

                retList.Clear();
                begin = Tools.GetTimestamp();
                Parallel.ForEach(dict, pair =>
                {
                    for (int i = 0; i < 100000; i++)
                    {
                    }
                });

                Debug.Log("duration2 = " + (Tools.GetTimestamp() - begin).ToString());

                retList.Clear();
                begin = Tools.GetTimestamp();
                foreach (var pair in dict)
                {
                    for (int i = 0; i < 100000; i++)
                    {
                    }
                }

                Debug.Log("duration3 = " + (Tools.GetTimestamp() - begin).ToString());
            }

            valueMonitorPool.Update();
        }