Esempio n. 1
0
        public WeaponsRow GetRow(string rowString)
        {
            WeaponsRow ret = null;

            try
            {
                ret = Rows[(int)Enum.Parse(typeof(rowIds), rowString)];
            }
            catch (ArgumentException) {
                Debug.LogError(rowString + " is not a member of the rowIds enumeration.");
            }
            return(ret);
        }
Esempio n. 2
0
        public WeaponsRow GetRow(rowIds rowID)
        {
            WeaponsRow ret = null;

            try
            {
                ret = Rows[(int)rowID];
            }
            catch (KeyNotFoundException ex)
            {
                Debug.LogError(rowID + " not found: " + ex.Message);
            }
            return(ret);
        }
Esempio n. 3
0
        public override void OnInspectorGUI()
        {
            Weapons    s = target as Weapons;
            WeaponsRow 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.LabelField(r._NAME);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("LIGHTATTACKID", GUILayout.Width(150.0f));
            {
                EditorGUILayout.LabelField(r._LIGHTATTACKID);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("HEAVYATTACKID", GUILayout.Width(150.0f));
            {
                EditorGUILayout.LabelField(r._HEAVYATTACKID);
            }
            EditorGUILayout.EndHorizontal();
        }