コード例 #1
0
    public void OnTriggerEnter(Collider collider)
    {
        Player player = collider.gameObject.GetComponent <Player>();

        if (player != null)
        {
            if (player.playerState.isLegendary)
            {
                enemyHealth.TakeDamage(player.GetCurrentDamage());
                //StartCoroutine(FlashDamage(0.33f));
                chainKillParticlePooler.SpawnFromQueueAndPlay(null, transform.position, Vector3.zero);
            }
            else
            {
                StartCoroutine(DelayedDamage(collider, player));
            }
        }
        else
        {
            EnemyDestroysRunestone edr = collider.gameObject.GetComponent <EnemyDestroysRunestone>();
            if (edr != null)
            {
                edr.WinOrLoose(false);
            }
            else
            {
                return;
            }
        }
    }
コード例 #2
0
    void Start()
    {
        player             = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
        playerDashChaining = player.GetComponent <PlayerDashChaining>();

        enemySpawn = GetComponent <EnemySpawn>();

        enemyDestroysRunestone = GameObject.FindGameObjectWithTag("RuneStone").GetComponent <EnemyDestroysRunestone>();
    }