Ejemplo n.º 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
     instance.Iniciar();
 }
Ejemplo n.º 2
0
    // 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;
    }