void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(this.gameObject); } instance.Iniciar(); }
// Use this for initialization void Start() { cameraRb = GetComponent <Rigidbody2D>(); GameObject player = GameObject.FindWithTag("Player"); if (player != null) { rbJugador = player.GetComponent <Rigidbody2D>(); jugador = player.GetComponent <Jugador>(); cameraRb.position = rbJugador.position; } PunteroRetardo aux = GameObject.FindObjectOfType <PunteroRetardo>(); if (aux != null) { punteroRb = aux.GetComponent <Rigidbody2D>(); } transformCamaraRelativo = transform.GetChild(0); velocidadTraslacionSimple = Vector2.zero; }