New answers tagged

0

I went down this route. Yes, isolating standard input and output is not enough. Sadly, they are blocking. You need an asynchronous solution. I modeled it as an state machine. You are either running your logic core, or waiting for input. The UI was also an state machine. The logic core could request any state from the UI, and that state could result in some ...


0

You've solved the core of the problem by expressing your game logic so that it's a set of functions that the UI code can use in whatever structure makes sense. for instance it relies on the writes in choice to happen and be concluded before the read, and also blocks on read. Unless I misunderstand, this isn't a feature of your logic_*, it's a feature of ...


0

It seems to me you can simplify what (I think) you are trying to achieve public List<GameObject> UI_Button_List = new List<GameObject>(3); void Update() { if (Input.GetMouseButtonDown(0)) { GameObject targetObject = EventSystem.current.currentSelectedGameObject.gameObject; if (targetObject != null && !...


0

Presumably you tried writing a script that sets the minWidth property on the LayoutElement attached to the same object, something like this? using UnityEngine; using UnityEngine.UI; [RequireComponent(typeof(LayoutElement))] public class LayoutElementAdjuster : MonoBehaviour { [Tooltip("What fraction of the screen width/height should be used as the ...


1

The main thing you should change is not hardcoding references to specific menus. public class Menu : MonoBehaviour { public IEnumerator Open() { //animation code here } public IEnumerator Close() { //animation code here } } IEnumerator MenuTransition(Menu menu1, Menu menu2) { yield return StartCoroutine(menu1.Close()); ...


2

The notifications fade into the screen (…) Don't do that. Making them appear suddenly would catch more attention. With that said, motion is probably a good idea. You can make the notification slide in the viewport. Another thing to try is to have a sound effect associated with it. As long as it does not bothers the players too much. We could argue for other ...


1

When you want the player to complete a tutorial before they progress, then it usually helps a lot to give the player a good reason to complete that tutorial. The direct way to do that is to simply prevent the player from progressing before they learned the mechanic you want to teach them. For example, if you want to teach the player how to jump, put the ...


Top 50 recent answers are included