示例#1
0
        public SampleCharactersRow GetRow(string in_RowString)
        {
            SampleCharactersRow ret = null;

            try
            {
                ret = Rows[(int)System.Enum.Parse(typeof(rowIds), in_RowString)];
            }
            catch (System.ArgumentException) {
                Debug.LogError(in_RowString + " is not a member of the rowIds enumeration.");
            }
            return(ret);
        }
示例#2
0
        public SampleCharactersRow GetRow(rowIds in_RowID)
        {
            SampleCharactersRow ret = null;

            try
            {
                ret = Rows[(int)in_RowID];
            }
            catch (System.Collections.Generic.KeyNotFoundException ex)
            {
                Debug.LogError(in_RowID + " not found: " + ex.Message);
            }
            return(ret);
        }
        public override void OnInspectorGUI()
        {
            SampleCharacters    s = target as SampleCharacters;
            SampleCharactersRow r = s.Rows[Index];

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("<<"))
            {
                Index = 0;
            }
            if (GUILayout.Button("<"))
            {
                Index -= 1;
                if (Index < 0)
                {
                    Index = s.Rows.Count - 1;
                }
            }
            if (GUILayout.Button(">"))
            {
                Index += 1;
                if (Index >= s.Rows.Count)
                {
                    Index = 0;
                }
            }
            if (GUILayout.Button(">>"))
            {
                Index = s.Rows.Count - 1;
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("ID", GUILayout.Width(150.0f));
            {
                EditorGUILayout.LabelField(s.rowNames[Index]);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Name", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Name);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Prefab", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Prefab);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Rotation", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Rotation);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Level", GUILayout.Width(150.0f));
            {
                EditorGUILayout.IntField(r._Level);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_CanFly", GUILayout.Width(150.0f));
            {
                EditorGUILayout.Toggle(System.Convert.ToBoolean(r._CanFly));
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Weapon", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Weapon);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Dialog", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Dialog);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Health", GUILayout.Width(150.0f));
            {
                EditorGUILayout.FloatField((float)r._Health);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Speed", GUILayout.Width(150.0f));
            {
                EditorGUILayout.FloatField((float)r._Speed);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Scale", GUILayout.Width(150.0f));
            {
                EditorGUILayout.FloatField((float)r._Scale);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Vector3Field("_Offset", r._Offset);
            EditorGUILayout.EndHorizontal();
        }