示例#1
0
    public void ApplyAction()
    {
        switch (activeAction)
        {
        case "Play":
            // play already reserved
            SetActionColor(defaultColor);
            break;

        case "FixObject":
            EventManager.DispatchEventWithText("SolveObstacle", "BrokenObject");
            if (unitActions.IsBadActor())
            {
                EventManager.DispatchEvent("LowerPlayQuality");
            }
            break;

        case "FixCurtain":
            EventManager.DispatchEventWithText("SolveObstacle", "BrokenCurtain");
            if (unitActions.IsBadActor())
            {
                EventManager.DispatchEvent("LowerPlayQuality");
            }
            break;

        case "FixHelper":
            EventManager.DispatchEventWithText("SolveObstacle", "BrokenHelper");
            if (unitActions.IsBadActor())
            {
                EventManager.DispatchEvent("LowerPlayQuality");
            }
            break;

        case "FixGhost":
            EventManager.DispatchEventWithText("SolveObstacle", "Ghost");
            if (unitActions.IsBadActor())
            {
                EventManager.DispatchEvent("LowerPlayQuality");
            }
            // borrow playwork for missing ghost
            ReservePlay();
            break;

        case "FixLight":
            EventManager.DispatchEventWithText("SolveObstacle", "LightDown");
            break;
        }

        activeAction = "";

        HideActionPanel();
        ResetActionIcon();
    }