unity how to make a ui disappear
using UnityEngine;
using UnityEngine.UI;
public class ScriptName : MonoBehaviour
{
[SerializeField]
private CanvasGroup Canvas;
// makes canvas invisible
void Awake()
{
Canvas.alpha = 0f;
Canvas.interactable = false;
Canvas.blocksRaycasts = false;
}
// when button is clicked canvas becomes visible
public void Click()
{
print("work");
Canvas.alpha = 1f;
Canvas.interactable = true;
Canvas.blocksRaycasts = true;
}
}
Also in C#:
- unity set material color
- generics in c#
- c# error "The name 'ViewBag' does not exist in the current context"
- c# EncoderParameter
- unity prevent system from creation
- what does gameobject.find return
- Microsoft.AspNetCore.Components.Forms.InputSelect`1.TryParseValueFromString(String value, TValue& result, String& validationErrorMessage)
- c# one line set
- c# max sequence contains no elements
- unity3d debug pause
- add text to combobox c#
- How to solve error in ExecuteNonQuery() in asp.net
- functions unity
- Rigidbody.addforce
- how to join array indexes with comma in c#
- convert string array to int C#
- how to go to other forms in C#
- c# anonymous class
- c# transform
- convert array object to int[] c#
- split string in c#
- How to look at an object unity
- entity framework update child records
- cshtml foreach