コード例 #1
0
ファイル: LightSwitch.cs プロジェクト: antoinenry/Ghost-Punch
    void OnTriggerStay2D(Collider2D other)
    {
        if (other.tag != "Player")
        {
            return;
        }

        PlayerControl p = other.GetComponent <PlayerControl> ();
        LightManager  l = lightObject.GetComponent <LightManager> ();

        if (p.IsUsing())
        {
            if (l.IsOff())
            {
                l.SetLight(1, switchDelay);
            }
            else
            {
                l.SetLight(0, switchDelay);
            }
        }
    }