SHARE
TWEET

Untitled

a guest May 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. One way to do this would be:
  2.  
  3. 1.  In the Volund prefab, select the CameraEquipmentAvatar, create a new tag called AvatarCamera, and set the CameraEquipmentAvatar GameObject tag to AvatarCamera.
  4.  
  5. 2.  In UIMainPanel.cs, add/change
  6.  
  7.     [HideInInspector]
  8.     private GameObject[] inventoryCams;
  9.  
  10.     private void EnableDisableAvatarCameras(bool enableIt)
  11.     {
  12.         if (inventoryCams == null)
  13.         {
  14.             inventoryCams = GameObject.FindGameObjectsWithTag("AvatarCamera");
  15.         }
  16.  
  17.         foreach (var cam in inventoryCams)
  18.         {
  19.             cam.SetActive(enableIt);
  20.         }
  21.     }
  22.  
  23.     private void Update()
  24.     {
  25.         GameObject player = Player.localPlayer;
  26.         if (player)
  27.         {
  28.             if (inventoryCams == null)
  29.             {
  30.                 EnableDisableAvatarCameras(false);
  31.             }
  32.  
  33.             // hotkey (not while typing in chat, etc.)
  34.             if (Input.GetKeyDown(hotKey) && !UIUtils.AnyInputActive())
  35.             {
  36.                 panel.SetActive(!panel.activeSelf);
  37.                 EnableDisableAvatarCameras(panel.active);
  38.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top