Advertisement
Pro_Unit

Lantern

Jan 13th, 2021
1,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. namespace ExtendedButtons
  4. {
  5.     public class Lantern : MonoBehaviour
  6.     {
  7.         public GameObject Myobj;
  8.  
  9.         public void OnClick()
  10.         {
  11.             if (Myobj.activeSelf)
  12.             {
  13.                 Myobj.SetActive(true);
  14.             }
  15.             else
  16.             {
  17.                 Myobj.SetActive(false);
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement