少年修仙传客户端基础资源
dabaoji
2023-11-13 0a23e1b83f8fda8ab9f9e32fe71c26c431faf63a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using UnityEditor;
using System.IO;
using System;
 
[CustomEditor(typeof(SoFoNormal))]
public class SoFoNormalEditor : SoFlyObjectEditor
{
    [MenuItem("程序/角色相关/技能配置/飞行物/普通")]
    static void CreateSoFoNormal()
    {
        SoFoNormal _config = CreateInstance<SoFoNormal>();
        string _createName = string.Format(ScriptableObjectLoader.SoFlyObject_Suffix,
                                           DateTime.UtcNow.ToFileTimeUtc());
        string _path = ResourcesPath.ResourcesOutPath + "refdata/ScriptableObject/SoFlyObject/";
        if (Directory.Exists(_path) == false)
        {
            Directory.CreateDirectory(_path);
        }
        _path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
                                      "refdata/ScriptableObject/SoFlyObject/",
                                      _createName,
                                      ".asset");
        AssetDatabase.CreateAsset(_config, _path);
        AssetDatabase.Refresh();
        ProjectWindowUtil.ShowCreatedAsset(_config);
    }
 
    private void OnEnable()
    {
        SoFoNormal _target = target as SoFoNormal;
        _target.type = SoFlyObject.E_FlyObjectType.Normal;
    }
 
    protected override void OnDrawInspectorGUI()
    {
        base.OnDrawInspectorGUI();
 
        SoFoNormal _target = target as SoFoNormal;
 
        _target.hspeed = EditorGUILayout.FloatField("水平速度", _target.hspeed);
        _target.acceleration = EditorGUILayout.FloatField("水平加速度", _target.acceleration);
        _target.vspeed = EditorGUILayout.FloatField("垂直初速度", _target.vspeed);
        _target.gravity = EditorGUILayout.FloatField("重力加速度", _target.gravity);
        _target.distance = EditorGUILayout.FloatField("距离", _target.distance);
    }
 
}