예제 #1
0
파일: Beacon.cs 프로젝트: gg-gify/Akira
    public override void AButtonPressed(PlayerController player)
    {
        if (isOnCooldown)
        {
            return;
        }
        if (player.GetHoldingLight() != null)
        {
            LightSource tmp = currentLight;
            SetCurrentLight(player.GetHoldingLight());
            player.SetHoldingLight(tmp);
        }
        else if (currentLight != null)
        {
            player.SetHoldingLight(currentLight);
            SetCurrentLight(null);
        }

        if (currentLight != null)
        {
            EmitLight(currentLight.GetColor(), maxLineWidth);
            currentBatteryStatus = MAX_BEACON_BATTERY;
        }
        else
        {
            ShutdownLight();
        }
        isOnCooldown        = true;
        currentCooldownTime = beaconInteractionCooldown;
    }