少年修仙传客户端代码仓库
client_linchunjie
2018-09-21 5d41a93123107a12d224f0b7b23c88faf648c950
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
3个文件已修改
121 ■■■■■ 已修改文件
Plugins/Trails/SmoothTrail.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/WindowCenter.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WorldMap/WorldMapWin.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Plugins/Trails/SmoothTrail.cs
@@ -28,7 +28,6 @@
        protected override void Update()
        {
            if (_emit)
            {
                _distanceMoved += Vector3.Distance(_t.position, _lastPosition);
@@ -56,71 +55,6 @@
            base.Update();
        }
        /*
        void OnDrawGizmos()
        {
            if (Application.isPlaying && _controlPoints != null)
            {
                for (int i = 0; i < _controlPoints.Count; i++)
                {
                    Gizmos.color = Color.red;
                    Gizmos.DrawSphere(_controlPoints[i].p, 0.01f);
                    if (i < _controlPoints.Count - 1)
                    {
                        Vector3 Handle1, Handle2;
                        float distanceBetween = Vector3.Distance(_controlPoints[i].p, _controlPoints[i + 1].p) / 2;
                        if (i == 0)
                        {
                            Handle1 = _controlPoints[i].p + (_controlPoints[i + 1].p - _controlPoints[i].p).normalized * distanceBetween;
                        }
                        else
                        {
                            Handle1 = _controlPoints[i].p + (_controlPoints[i + 1].p - _controlPoints[i - 1].p).normalized * distanceBetween;
                        }
                        int nextI = i + 1;
                        if (nextI == _controlPoints.Count - 1)
                        {
                            Handle2 = _controlPoints[nextI].p + (_controlPoints[nextI - 1].p - _controlPoints[nextI].p).normalized * distanceBetween;
                        }
                        else
                        {
                            Handle2 = _controlPoints[nextI].p + (_controlPoints[nextI - 1].p - _controlPoints[nextI + 1].p).normalized * distanceBetween;
                        }
                        Gizmos.color = Color.green;
                        Gizmos.DrawSphere(Handle1, 0.01f);
                        Gizmos.DrawLine(_controlPoints[i].p, Handle1);
                        Gizmos.color = Color.blue;
                        Gizmos.DrawSphere(Handle2, 0.01f);
                        Gizmos.DrawLine(_controlPoints[nextI].p, Handle2);
                        Vector3 current = _controlPoints[i].p;
                        for (int pointBetween = 0; pointBetween < PointsBetweenControlPoints; pointBetween++)
                        {
                            Vector3 next = GetPointAlongCurve(_controlPoints[i].p, Handle1, _controlPoints[i + 1].p, Handle2, ((pointBetween + 1) / ((float)PointsBetweenControlPoints + 1f)), 0.3f);
                            Gizmos.DrawLine(current, next);
                            Gizmos.color = Color.yellow;
                            Gizmos.DrawSphere(next, 0.01f);
                            current = next;
                        }
                        Gizmos.color = Color.blue;
                        Gizmos.DrawLine(current, _controlPoints[i + 1].p);
                    }
                }
            }
        }
        */
        protected override void OnStartEmit()
        {
@@ -210,40 +144,6 @@
            int lastControlPointPointIndex = ((_controlPoints.Count - 1) + ((_controlPoints.Count - 1) * PointsBetweenControlPoints));
            int prevControlPointPointIndex = lastControlPointPointIndex - PointsBetweenControlPoints - 1;
            int activePointCount = lastControlPointPointIndex + 1;
            /*
             *
             * This is that optimisation mentioned above..sort of works, but smoothing isn't working right so i am leaving it out for now
             *
             *
            int lastControlPointIndex = _controlPoints.Count - 1;
            int prevControlPointIndex = _controlPoints.Count - 2;
            Vector3 Handle1, Handle2;
            float distanceBetween = Vector3.Distance(_controlPoints[lastControlPointIndex].p, _controlPoints[prevControlPointIndex].p) / 2;
            if (prevControlPointIndex == 0)
                Handle1 = _controlPoints[prevControlPointIndex].p + (_controlPoints[lastControlPointIndex].p - _controlPoints[prevControlPointIndex].p).normalized * distanceBetween;
            else
                Handle1 = _controlPoints[prevControlPointIndex].p + (_controlPoints[lastControlPointIndex].p - _controlPoints[prevControlPointIndex - 1].p).normalized * distanceBetween;
            Handle2 = _controlPoints[lastControlPointIndex].p + (_controlPoints[prevControlPointIndex].p - _controlPoints[lastControlPointIndex].p).normalized * distanceBetween;
            float timeActiveLastControlPoint = trail.Points[lastControlPointPointIndex].TimeActive();
            float timeActivePrevControlPoint = trail.Points[prevControlPointPointIndex].TimeActive();
            for (int pointBetween = 0; pointBetween < PointsBetweenControlPoints; pointBetween++)
            {
                float t= (((float)pointBetween + 1f) / ((float)PointsBetweenControlPoints + 1f));
                trail.Points[prevControlPointPointIndex + pointBetween + 1].Position = GetPointAlongCurve(_controlPoints[prevControlPointIndex].p, Handle1, _controlPoints[lastControlPointIndex].p, Handle2, t, 0.3f);
                trail.Points[prevControlPointPointIndex + pointBetween + 1].SetTimeActive(Mathf.Lerp(timeActivePrevControlPoint, timeActiveLastControlPoint, t));
            }
            trail.Points[lastControlPointPointIndex].Position = _controlPoints[lastControlPointIndex].p;
            */
            float distanceFromStart = trail.Points[prevControlPointPointIndex].GetDistanceFromStart();
            for (int i = prevControlPointPointIndex + 1; i < activePointCount; i++)
System/WindowBase/WindowCenter.cs
@@ -72,7 +72,7 @@
                }
                else
                {
                    DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
                    DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
                }
            }
            else
@@ -146,7 +146,7 @@
                }
                else
                {
                    DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
                    DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
                }
                return (T)win;
@@ -201,13 +201,13 @@
                }
                else
                {
                    DebugEx.Log(string.Format("{0} 窗口已经关闭!", typeof(T)));
                    DebugEx.LogFormat("{0} 窗口已经关闭!", typeof(T));
                }
            }
            else
            {
                asyncLoad.StopTask(typeof(T).Name);
                DebugEx.Log(string.Format("{0} 窗口无法获得!", typeof(T)));
                DebugEx.LogFormat("{0} 窗口无法获得!", typeof(T));
            }
            return win;
@@ -224,13 +224,13 @@
                }
                else
                {
                    DebugEx.Log(string.Format("{0} 窗口已经关闭!", typeof(T)));
                    DebugEx.LogFormat("{0} 窗口已经关闭!", typeof(T));
                }
            }
            else
            {
                asyncLoad.StopTask(typeof(T).Name);
                DebugEx.Log(string.Format("{0} 窗口无法获得!", typeof(T)));
                DebugEx.LogFormat("{0} 窗口无法获得!", typeof(T));
            }
            return win;
@@ -385,7 +385,7 @@
            }
            else
            {
                DebugEx.Log(string.Format("{0} 窗口无法获得!", typeof(T)));
                DebugEx.LogFormat("{0} 窗口无法获得!", typeof(T));
            }
        }
@@ -544,7 +544,7 @@
                }
                else
                {
                    DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
                    DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
                }
                return (T)win;
@@ -577,7 +577,7 @@
                            }
                            else
                            {
                                DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
                                DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
                            }
                        }
                    }
System/WorldMap/WorldMapWin.cs
@@ -92,7 +92,7 @@
            WorldMapAreaBehaviour playerAtBehaviour = null;
            var currentMapId = PlayerDatas.Instance.baseData.MapID;
            m_ContainerPlayerHead.gameObject.SetActive(false);
            for (int i = 0; i < m_AreaBehaviours.Length; i++)
            {
                var behaviourTable = m_AreaBehaviours[i];
@@ -104,6 +104,7 @@
                    behaviourTable.areaBehaviour.Init(area);
                    if (behaviourTable.id == currentMapId.ToString())
                    {
                        m_ContainerPlayerHead.gameObject.SetActive(true);
                        playerAtBehaviour = behaviourTable.areaBehaviour;
                        m_ContainerPlayerHead.SetParentEx(behaviourTable.areaBehaviour.playerHead, Vector3.zero, Vector3.zero, Vector3.one);
                    }