Pro_Unit

UIControllSwitcher

May 12th, 2020
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class UIControllSwitcher : MonoBehaviour
  4. {
  5.     [SerializeField] private GameObject _playerCotrollButtons;
  6.     [SerializeField] private GameObject _carCotrollButtons;
  7.  
  8.     public void OnEnterCar()
  9.     {
  10.         _playerCotrollButtons.SetActive(false);
  11.         _carCotrollButtons.SetActive(true);
  12.     }
  13.     public void OnExitCar()
  14.     {
  15.         _playerCotrollButtons.SetActive(true);
  16.         _carCotrollButtons.SetActive(false);
  17.     }
  18. }
Add Comment
Please, Sign In to add comment