Пример #1
0
    private void Awake()
    {
        Instance      = this;
        IsGameRunning = true;
        roundTimer    = levelFightTime;

        BGM = BGM.Initialize(gameObject);
        BGM.Play();
        //levels = levels.RandomizeList();
    }
Пример #2
0
    protected virtual void OnTriggerEnter2D(Collider2D other)
    {
        IPickUp pickUp = other.gameObject.GetComponent <IPickUp> ();

        if (pickUp != null)
        {
            pickUp.PickUpBehaviour(this);
            pickUpSound.Play();
        }
    }
Пример #3
0
    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);
    }
Пример #6
0
 public void PlayButtonPressSound()
 {
     buttonPress.Play();
 }