Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- One way to do this would be:
- 1. In the Volund prefab, select the CameraEquipmentAvatar, create a new tag called AvatarCamera, and set the CameraEquipmentAvatar GameObject tag to AvatarCamera.
- 2. In UIMainPanel.cs, add/change
- [HideInInspector]
- private GameObject[] inventoryCams;
- private void EnableDisableAvatarCameras(bool enableIt)
- {
- if (inventoryCams == null)
- {
- inventoryCams = GameObject.FindGameObjectsWithTag("AvatarCamera");
- }
- foreach (var cam in inventoryCams)
- {
- cam.SetActive(enableIt);
- }
- }
- private void Update()
- {
- GameObject player = Player.localPlayer;
- if (player)
- {
- if (inventoryCams == null)
- {
- EnableDisableAvatarCameras(false);
- }
- // hotkey (not while typing in chat, etc.)
- if (Input.GetKeyDown(hotKey) && !UIUtils.AnyInputActive())
- {
- panel.SetActive(!panel.activeSelf);
- EnableDisableAvatarCameras(panel.active);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement