void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); return; } Instance = this; }
void Start() { game = GameServices.Instance; game.addMoveEvent(setTarget); game.addZoomEvent(setZoom); InvokeRepeating("moveCamera", 0, Time.deltaTime); //InvokeRepeating("zoomCamera", 0, Time.deltaTime); targetPos = Position; targetZoom = Position.z; }