示例#1
0
    private void OnCollisionEnter(Collision collision)
    {
        if (!GameBehaviour.isPlayable)
        {
            return;
        }

        if (collision.gameObject.CompareTag("Player"))
        {
            sphereCollider.enabled = false;
            rb.velocity            = Vector3.zero;

            SoundManager.PlaySE(SoundManager.AUDIO_LIST.ITEM);

            GameParams.AddScore(point * EnemySpawner.enemyCount);
            EnemySpawner.IncrementEnemy();
            EnemySpawner.ChangeDir();
            anim.SetTrigger("Get");

            if (getParticle != null)
            {
                Instantiate(getParticle, transform.position, Quaternion.identity);
            }
        }
    }