Пример #1
0
    public override void OnInspectorGUI()
    {
        EditorGUILayout.Space();

        CustomEditorUtility.DrawTitle("Pool Manager");
        CustomEditorUtility.QuickSerializeObject("instantiateOnAwake", serializedObject);
        DrawPools();
        RefreshPoolsButton();
        AddPoolButton();
        DestroyPoolsButton();
        serializedObject.ApplyModifiedProperties();
    }
Пример #2
0
        private void DrawGeneralSettings()
        {
            EditorGUILayout.BeginVertical("box");

            CustomEditorUtility.QuickSerializeObject("feedbackName", serializedObject);
            CustomEditorUtility.QuickSerializeObject("enableDebug", serializedObject);
            CustomEditorUtility.QuickSerializeObject("generalDelay", serializedObject);
            if (f.enableDebug)
            {
                CustomEditorUtility.QuickSerializeObject("debugKey", serializedObject);
            }
            EditorGUILayout.EndVertical();
        }
Пример #3
0
    public override void OnInspectorGUI()
    {
        EditorGUI.BeginChangeCheck();

        CustomEditorUtility.DrawTitle(t.name.Replace("POW_", ""));

        CustomEditorUtility.QuickSerializeObject("cooldown", serializedObject);

        EditorGUILayout.LabelField("Actions", EditorStyles.boldLabel);

        SerializedProperty actions = serializedObject.FindProperty("actions");

        for (int i = 0; i < actions.arraySize; i++)
        {
            EditorGUILayout.BeginVertical("box");
            SerializedProperty action = actions.GetArrayElementAtIndex(i);

            EditorGUILayout.BeginHorizontal();
            if (i < t.actions.Count)
            {
                t.actions[i].enabled = EditorGUILayout.Toggle(t.actions[i].enabled);
            }
            CustomEditorUtility.QuickSerializeRelative("delay", action);
            if (CustomEditorUtility.RemoveButton())
            {
                Undo.RecordObject(t, "Remove");
                t.actions.RemoveAt(i);
            }
            EditorGUILayout.EndHorizontal();

            CustomEditorUtility.QuickSerializeRelative("action", action);
            EditorGUILayout.EndVertical();
        }

        if (CustomEditorUtility.AddButton())
        {
            Undo.RecordObject(t, "Add");
            t.actions.Add(new PowerActionSettings());
        }

        if (EditorGUI.EndChangeCheck())
        {
            EditorUtility.SetDirty(t);
            Repaint();
        }
        serializedObject.ApplyModifiedProperties();
    }
Пример #4
0
    public override void OnInspectorGUI()
    {
        EditorGUI.BeginChangeCheck();

        CustomEditorUtility.DrawTitle("Instantiate " + EntityNames[t.indexInPool]);


        t.indexInPool = EditorGUILayout.Popup(t.indexInPool, EntityNames.ToArray());

        CustomEditorUtility.QuickSerializeObject(EntityNames[t.indexInPool], serializedObject);

        serializedObject.ApplyModifiedProperties();
        if (EditorGUI.EndChangeCheck())
        {
            EditorUtility.SetDirty(t);
        }
    }