using UnityEngine;
using UnityEngine.EventSystems;
using DG.Tweening;
public class Hotspot : MonoBehaviour
{
public GameObject ThisPanorama;
public GameObject TargetPanorama;
// Update is called once per frame
void Update()
{
transform.Rotate(0, 0.5f, 0);
}
public void OnMouseDown(PointerEventData eventData)
{
OnMouseDown(eventData);
OnHotspotTransition();
}
public void OnMouseEnter(PointerEventData eventData)
{
transform.DOScale(new Vector3(0.08f, 0.08f, 0.08f), 0.3f);
}
public void OnMouseExit(PointerEventData eventData)
{
transform.DOScale(new Vector3(0.05f, 0.05f, 0.05f), 0.3f);
}
public void OnHotspotTransition()
{
SetSkyBox();
}
private void SetSkyBox()
{
if (TourManager.SetCameraPosition != null)
TourManager.SetCameraPosition(TargetPanorama.transform.position, ThisPanorama.transform.position);
TargetPanorama.gameObject.SetActive(true);
ThisPanorama.gameObject.SetActive(false);
}
}
Anyone know why this isn’t working for me? Just trying to get a sphere to scale up as you mouse over it then scale back down after the mouse leaves.