/// <summary>
    /// Display a custom inspector for the hero kit action.
    /// </summary>
    public override void OnInspectorGUI()
    {
        // show existing inspector
        base.OnInspectorGUI();

        if (GUILayout.Button("Edit Hero Action"))
        {
            HeroKitEditor.ButtonClickHeroActionAsset(heroKitAction);
        }
    }
    /// <summary>
    /// Display a custom inspector for the hero kit property.
    /// </summary>
    public override void OnInspectorGUI()
    {
        // show existing inspector
        base.OnInspectorGUI();

        if (GUILayout.Button("Edit Hero Property"))
        {
            HeroKitEditor.ButtonClickHeroPropertyAsset(heroKitProperty);
        }
    }
Exemple #3
0
    /// <summary>
    /// Show a button to open custom editor.
    /// </summary>
    public override void OnInspectorGUI()
    {
        if (GUILayout.Button("Edit Hero Object"))
        {
            HeroKitEditor.ButtonClickHeroObjectAsset(heroObject);
        }

        if (GUILayout.Button("Show Details"))
        {
            ToggleDetails();
        }

        // show existing inspector
        if (showDetails)
        {
            base.OnInspectorGUI();
        }
    }
Exemple #4
0
    /// <summary>
    /// Display a custom inspector for the hero kit object.
    /// </summary>
    public override void OnInspectorGUI()
    {
        HeroObject oldHeroObject = heroKitObject.heroObject;

        heroKitObject.heroObject = SimpleLayout.ObjectField("Hero Object", 100, heroKitObject.heroObject, 200, false);
        HeroObject newHeroObject = heroKitObject.heroObject;

        // has hero object changed? if yes, refresh graphics
        if (newHeroObject != oldHeroObject)
        {
            HeroKit.Scene.HeroKitCommonRuntime.RefreshVisuals(heroKitObject);
        }

        if (heroKitObject.heroObject == null)
        {
            SimpleLayout.BeginVertical(EditorStyles.helpBox);
            SimpleLayout.Label("Drag the hero object you want to use from the Project Tab into the field above. Or you can choose an existing hero object by selecting the icon to the right of the field above.\n\nIf you want to create a new hero object and assign it to this field, click the button below.", true);
            SimpleLayout.EndVertical();
            if (GUILayout.Button("Create & Assign Hero Object"))
            {
                heroKitObject.heroObject = HeroKitCommon.AddHeroObjectToFolder(false);
                Selection.activeObject   = heroKitObject.transform;
            }
        }

        else if (heroKitObject.heroObject != null)
        {
            if (GUILayout.Button("Edit Hero Object"))
            {
                HeroKitEditor.ButtonClickHeroObjectAsset(heroKitObject.heroObject);
            }

            if (GUILayout.Button("Show Details"))
            {
                ToggleDetails();
            }

            // show existing inspector
            if (showDetails)
            {
                base.OnInspectorGUI();
            }
        }
    }