Topic: Hide the GUI for intros and outros

Hi again,

I am not sure if this question was asked, but is there a way to hide the main GUI during a character intro/outro or during the win screen?

Share

Thumbs up Thumbs down

Re: Hide the GUI for intros and outros

You could make a script that simply disables the battle gui object when a certain move plays.

Share

Thumbs up +1 Thumbs down

Re: Hide the GUI for intros and outros

I'm fairly certain that you could quite easily code in a way to have everything in the UI as the child of a gameobject and then have that gameobject setactive true/false when you want it in the DefaultBattleGUI.cs script

Share

Thumbs up +1 Thumbs down

4 (edited by Mistermind 2022-02-26 21:44:31)

Re: Hide the GUI for intros and outros

Along with what Starcutter said, use a move event such as "OnMove" to order the UI to disable when the intro move plays, then use "OnRoundBegins" to renable the UI:
http://www.ufe3d.com/doku.php/code

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.

Re: Hide the GUI for intros and outros

Nice,

I'm still a beginner when it comes to coding.
Do you have a step by step tutorial so I know where to place the coding?

The link http://www.ufe3d.com/doku.php/code is confusing to me.

Share

Thumbs up Thumbs down

Re: Hide the GUI for intros and outros

Try this script

using UnityEngine;
using UFE3D;

public class ThreadRequest : MonoBehaviour
{
    [SerializeField]
    private GameObject battleGUI;

    [SerializeField]
    private string[] moveNames;

    // Start is called before the first frame update
    void Start()
    {
        UFE.OnMove += this.OnMove;
        UFE.OnRoundBegins += this.OnRoundBegins;
    }

    void OnDestroy()
    {
        UFE.OnMove -= this.OnMove;
        UFE.OnRoundBegins -= this.OnRoundBegins;
    }

    private void OnMove(MoveInfo move, ControlsScript player)
    {
        int length = moveNames.Length;
        for (int i = 0; i < length; i++)
        {
            if (move.moveName == moveNames[i])
            {
                if (battleGUI != null)
                {
                    battleGUI.SetActive(false);
                }
            }
        }
    }

    private void OnRoundBegins(int newInt)
    {
        if (battleGUI != null)
        {
            battleGUI.SetActive(true);
        }
    }
}

Share

Thumbs up +1 Thumbs down