少年修仙传客户端代码仓库
client_linchunjie
2018-08-21 7bf61af608615884ab5a4a83569639d538ed665b
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
48
49
50
51
52
53
54
55
56
57
58
59
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class TalentSkillScriptableObject : ScriptableObject
{
    [SerializeField] Vector3[] m_SkillPositions;
    [SerializeField] Arrow[] m_Arows;
    [SerializeField] float m_ContentHeight;
    public Vector3 GetSkillPosition(int index)
    {
        if (m_SkillPositions != null && index >= 0 && index < m_SkillPositions.Length)
        {
            return m_SkillPositions[index];
        }
        return Vector3.zero;
    }
 
    public Arrow GetArrow(int index)
    {
        if (m_Arows != null && index >= 0 && index < m_Arows.Length)
        {
            return m_Arows[index];
        }
        return default(Arrow);
    }
 
    public float contentHeight
    {
        get { return m_ContentHeight; }
    }
 
    [Serializable]
    public struct Arrow
    {
        public int type;
        public Vector3 position;
        public Vector3 eulerAngle;
        public Vector2 sizeDelta;
    }
 
 
#if UNITY_EDITOR
    [MenuItem("策划工具/生成天赋技能配置文件")]
    static void BuildMeridianConfig()
    {
        TalentSkillScriptableObject _config = CreateInstance<TalentSkillScriptableObject>();
        string _path = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/",
                                      "TalentSkill_",
                                      ".asset");
        AssetDatabase.CreateAsset(_config, _path);
        AssetDatabase.Refresh();
        ProjectWindowUtil.ShowCreatedAsset(_config);
    }
#endif
}