Exemple #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("OnTriggerEnter2D: " + other);
        RubyController rubyCtrl = other.GetComponent <RubyController>();

        if (rubyCtrl != null)
        {
            for (int i = 0; i < rubyCtrl.bullet.Length; i++)
            {
                if (rubyCtrl.bullet[i] == null)
                {
                    rubyCtrl.bullet[i] = Bullet;
                    rubyCtrl.ChangeBullet(bulletCount);
                    Vector2 point = gameObject.transform.position;
                    GameManager.instance.SpawnInSec(GameManager.instance.Ammos[0], point, 2.0f);
                    Destroy(gameObject);
                    return;
                }
            }
        }
    }