private void Awake()
    {
        rb = GetComponent <Rigidbody2D>();
        Assert.IsNotNull(rb);

        AttackPlayer attack = GetComponent <AttackPlayer>();

        Assert.IsNotNull(attack);

        attack.AddHitPlayerCallback(HitPlayer);
    }
    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);
    }
Beispiel #3
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);
    }