示例#1
0
    private void Awake()
    {
        Instance      = this;
        IsGameRunning = true;
        roundTimer    = levelFightTime;

        BGM = BGM.Initialize(gameObject);
        BGM.Play();
        //levels = levels.RandomizeList();
    }
    protected virtual void OnTriggerEnter2D(Collider2D other)
    {
        IPickUp pickUp = other.gameObject.GetComponent <IPickUp> ();

        if (pickUp != null)
        {
            pickUp.PickUpBehaviour(this);
            pickUpSound.Play();
        }
    }
    private void Awake()
    {
        instance      = this;
        mainMenuMusic = mainMenuMusic.Initialize(gameObject);
        mainMenuMusic.Play();

        buttonPress = buttonPress.Initialize(gameObject);

        beeping = beeping.Initialize(gameObject);
        //timer.gameObject.SetActive(false);
    }
示例#4
0
    protected override void Update()
    {
        if (bounceCounter >= maxBounce)
        {
            gameObject.Explode(explosionForce, transform.position, explosionRadius);

            if (explosionSound)
            {
                explosionSound.Play();
            }

            if (impactAnimation)
            {
                impactAnimation.SetBool("Impact", true);
            }

            gameObject.GetComponent <Renderer> ().enabled     = false;
            gameObject.GetComponent <Rigidbody2D> ().velocity = Vector2.zero;
            Destroy(gameObject, 0.5f);
        }
    }
示例#5
0
    protected override void collisionBehaviour(Collision2D col)
    {
        gameObject.Explode(explosionForce, transform.position, explosionRadius);
        shakeCam.Shake(10);

        if (explosionSound)
        {
            explosionSound.Play();
        }

        if (impactAnimation)
        {
            impactAnimation.SetBool("Impact", true);
        }

        gameObject.GetComponent <Renderer> ().enabled     = false;
        gameObject.GetComponent <Rigidbody2D> ().velocity = Vector2.zero;
        Destroy(gameObject, 0.5f);
    }
 public void PlayButtonPressSound()
 {
     buttonPress.Play();
 }