少年修仙传客户端代码仓库
client_Hale
2018-12-20 21e5433384dcf078b817f9b42dfe4f6c5b3f1ace
update 动态障碍点客户端工具创建
2个文件已修改
55 ■■■■ 已修改文件
Fight/Stage/MapEditor/SoMap.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/RuntimeLogUtility.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/MapEditor/SoMap.cs
@@ -113,20 +113,20 @@
            if (end.x > start.x)
            {
                _centerX = (end.x - start.x) * .5f + _width * .5f;
                _centerX = (end.x * .5f - start.x * .5f) * .5f + start.x * .5f;
            }
            else
            {
                _centerX = (end.x - start.x) * .5f - _width * .5f;
                _centerX = (end.x * .5f - start.x * .5f) * .5f + end.x * .5f;
            }
            if (end.z > start.z)
            {
                _centerZ = (end.z - start.z) * .5f + _length * .5f;
                _centerZ = (end.z * .5f - start.z * .5f) * .5f + start.z * .5f;
            }
            else
            {
                _centerZ = (start.z - end.z) * .5f - _length * .5f;
                _centerZ = (start.z * .5f - end.z * .5f) * .5f + end.z * .5f;
            }
Utility/RuntimeLogUtility.cs
@@ -42,6 +42,9 @@
    public static bool s_HurtValueLog = false;
    public static UnityEngine.AI.NavMeshObstacle obstacle;
    public static SFXController sfx;
    public static void ClearLogs()
    {
        s_LogDict.Clear();
@@ -181,6 +184,8 @@
    private Vector3 _navChkPos;
    private int _param1;
    private int _param2;
    private Vector2 _start;
    private Vector2 _end;
    public override void OnInspectorGUI()
    {
@@ -223,12 +228,48 @@
            }
        }
        _param1 = EditorGUILayout.IntField("param1", _param1);
        _param2 = EditorGUILayout.IntField("param2", _param2);
        if (GUILayout.Button("酷酷酷"))
        _start = EditorGUILayout.Vector2Field("开始点", _start);
        _end = EditorGUILayout.Vector2Field("结束点", _end);
        _param1 = EditorGUILayout.IntField("角度", _param1);
        if (GUILayout.Button("创建障碍点"))
        {
            PlayerDatas.Instance.hero.SwitchGodWeapon(_param1, _param2);
            if (RuntimeLogUtility.obstacle)
            {
                DestroyImmediate(RuntimeLogUtility.obstacle.gameObject);
            }
            if (RuntimeLogUtility.sfx)
            {
                SFXPlayUtility.Instance.Release(RuntimeLogUtility.sfx);
            }
            RuntimeLogUtility.obstacle = SoMap.CreateImpasse.General(new Vector3(_start.x, 0, _start.y),
                new Vector3(_end.x, 0, _end.y), _param1);
            var _pos = RuntimeLogUtility.obstacle.transform.position;
            var _y = 0f;
            if (CollisionUtility.TryGetGroundHeight(_pos, out _y))
            {
                _pos.y = _y;
            }
            float _scale = 1;
            _scale = RuntimeLogUtility.obstacle.transform.localScale.x * 0.25f;
            RuntimeLogUtility.sfx = SFXPlayUtility.Instance.PlayWithEulerAngle(1040, _pos, RuntimeLogUtility.obstacle.transform.eulerAngles);
            RuntimeLogUtility.sfx.duration = 0;
            RuntimeLogUtility.sfx.transform.localScale = new Vector3(_scale, 1, 1);
        }
        if (GUILayout.Button("清除障碍点"))
        {
            if (RuntimeLogUtility.obstacle)
            {
                DestroyImmediate(RuntimeLogUtility.obstacle.gameObject);
            }
            if (RuntimeLogUtility.sfx)
            {
                SFXPlayUtility.Instance.Release(RuntimeLogUtility.sfx);
            }
        }
        if (GUILayout.Button("直接重连"))