// 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; } }
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); }