// Start is called before the first frame update
 void Start()
 {
     hotspot = GetComponent <HotspotScript>();
     if (hotspot == null)
     {
         Debug.LogError("No Hotspot Component Found.");
         Destroy(this);
         return;
     }
 }
Пример #2
0
    private static HotspotSerialized SerializeHotspot(HotspotScript hotspot)
    {
        HotspotSerialized serializedHotspot = new HotspotSerialized();

        Vector3 screenPos = AbstractImmersiveCamera.CurrentImmersiveCamera.cameras[0].WorldToScreenPoint(hotspot.transform.position);

        serializedHotspot.position = new Vector2(screenPos.x, screenPos.y);
        serializedHotspot.name     = hotspot.name;
        print(serializedHotspot.name);

        return(serializedHotspot);
    }