Exemplo n.º 1
0
    private void Awake()
    {
        Assert.IsTrue(speed > 0);

        AttackPlayer attackPlayer = GetComponent <AttackPlayer>();

        Assert.IsNotNull(attackPlayer);

        attackPlayer.AddHitEnemyCallback(Flip);
        attackPlayer.AddHitPlayerCallback(Flip);

        rb = GetComponent <Rigidbody2D>();
        Assert.IsNotNull(rb);
    }
Exemplo n.º 2
0
    private void Awake()
    {
        Assert.IsTrue(speed > 0);

        AttackPlayer attackPlayer = GetComponent <AttackPlayer>();

        Assert.IsNotNull(attackPlayer);

        attackPlayer.AddHitEnemyCallback(Collided);
        attackPlayer.AddHitPlayerCallback(Collided);

        rb = GetComponent <Rigidbody2D>();
        Assert.IsNotNull(rb);
        rb.velocity = new Vector3(speed, 0, 0);
    }