Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity enable gameobject

GameObject.Find("PlayMenu 3").SetActive(false);
// you could also store a GameObject as  variable
Comment

unity enable gameobject


 // Drag & Drop the gameobject in the inspector
 public GameObject targetGameObject ;

 public void DisableGameObject()
 {
      targetGameObject.SetActive( false ) ;
 }

 public void EnableGameObject()
 {
      targetGameObject.SetActive( true ) ;
 }

 public void ToggleGameObject()
 {
      if( targetGameObject.activeSelf )
           DisableGameObject() ;
      else
           EnableGameObject();
 }

Comment

on GAMEOBJECT enable unity

    void OnEnable()
    {
        Debug.Log("PrintOnEnable: script was enabled");
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: url()- full() laravel 
Csharp :: c# list to string 
Csharp :: stop program event in unity code 
Csharp :: get absolute url c# 
Csharp :: c# list files in directory 
Csharp :: base64 to image c# 
Csharp :: camera follow player unity smooth 
Csharp :: Linq - Random Elements 
Csharp :: c# how to check string is number 
Csharp :: asp.net core get request ip address 
Csharp :: add two numbers in c# 
Csharp :: c# int input 
Csharp :: c# resize image keep aspect ratio 
Csharp :: C# save pdf stream to file 
Csharp :: string to enum c# 
Csharp :: unity copy to clipboard 
Csharp :: c# console create window 
Csharp :: how to lock and hide the cursor unity 
Csharp :: c# get object property value by name 
Csharp :: mailkit send attachment 
Csharp :: unity time.deltatime timescale 0 
Csharp :: unity get scene index 
Csharp :: base64decode C# 
Csharp :: json property annotation c# 
Csharp :: making beep voice in c# 
Csharp :: unity invisible cube 
Csharp :: turtle graphics face in direction 
Csharp :: system.linq.iorderedenumerable`2[system.char,system.char] çözümü 
Csharp :: how to show a reference in unity 
Csharp :: c# serviceCollection AddLogging 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =