コード例 #1
0
ファイル: DeathVolume.cs プロジェクト: JesseMan/Blasten
    void OnTriggerEnter(Collider other)
    {
        PlatformerController controller = other.gameObject.GetComponent <PlatformerController>();

        if (controller && controller.HasControl())
        {
            //let player die
            StartCoroutine(PlayerDeath(other.gameObject));
        }
    }
コード例 #2
0
    void OnTriggerEnter(Collider other)
    {
        PlatformerController controller = other.gameObject.GetComponent <PlatformerController>();
        PlayerCombat         combat     = other.GetComponent <PlayerCombat>();
        grimInfo             info       = other.GetComponent <grimInfo> ();
        int spikeDamage = 1;

        if (controller && controller.HasControl())
        {
            info.Damage(spikeDamage);
        }
    }