Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        GameObject       collisionWith = other.gameObject;
        S_PlayerMovement player        = collisionWith.GetComponent <S_PlayerMovement>();

        if (player != null)
        {
            player.Destruction();
            StartCoroutine(CameraShake.Shake(1f, 1f));
            Destruction();
        }
    }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        GameObject collisionWith = other.gameObject;
        S_Enemy    enemy         = collisionWith.GetComponent <S_Enemy>();

        if (enemy != null)
        {
            ParentSpaceship.GetComponent <S_PlayerMovement>().score += 100;
            float score = ParentSpaceship.GetComponent <S_PlayerMovement>().score;
            Debug.Log(score);
            enemy.Destruction();
            StartCoroutine(CameraShake.Shake(.2f, .1f));
            Destruction();
        }
    }