void Distanciando() { if(cameraObj.camera.orthographicSize < zoomLonge){ cameraObj.camera.orthographicSize += zoomSpeed * Time.deltaTime; ultimoZoom = "Distanciando"; } else { estadocamera = EstadoCamera.estatica; } }
void Aproximando() { if(cameraObj.camera.orthographicSize > zoomperto){ cameraObj.camera.orthographicSize -= zoomSpeed * Time.deltaTime; ultimoZoom = "Aproximando"; } else { estadocamera = EstadoCamera.estatica; } }
void OnTriggerEnter(Collider other) { if(other.gameObject.tag == "Camera+z"){ estadocamera = EstadoCamera.aproximando; Destroy (other.gameObject); } if(other.gameObject.tag == "Camera-z"){ estadocamera = EstadoCamera.distanciando; Destroy (other.gameObject); } if(other.gameObject.tag == "CameraAjustaFoco"){ estadocamera = EstadoCamera.ajustaFoco; Destroy (other.gameObject); } }
// Use this for initialization void Start() { estadocamera = EstadoCamera.estatica; }