Esempio n. 1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.CompareTag("BulletShell"))
        {
            Destroy(other.gameObject);
            return;
        }

        PlayerGameplay pgpComponent = other.GetComponent <PlayerGameplay>();

        if (null != pgpComponent)
        {
            pgpComponent.OnDie();

            TriggerDeathEffect(pgpComponent.transform.position);
        }
        else
        {
            PlayerGameplayRunner pgpComponentRunner = other.GetComponent <PlayerGameplayRunner>();
            if (null != pgpComponentRunner)
            {
                pgpComponentRunner.OnDie();

                TriggerDeathEffect(pgpComponentRunner.transform.position);
            }
        }
    }
Esempio n. 2
0
    public void OnPlayerValidated(Material mat, int playerId)
    {
        GameObject prefab = Instantiate(CharacPrefab, new Vector3(playerId * -1.3f, -2.0f, 0.5f), CharacPrefab.transform.rotation);

        aCharacters[playerId] = prefab;
        PlayerGameplayRunner charac = prefab.GetComponent <PlayerGameplayRunner>();

        if (charac != null)
        {
            charac.material = mat;
            playerCounter++;
        }
    }