Esempio n. 1
0
    private static IEnumerator AddBloodCoroutine(BodyPart bodyPart, float seconds, int goldCost, int blood)
    {
        Clock clock = MonoBehaviour.FindObjectOfType <Clock>();

        clock.StartClockUntil(seconds);
        ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>();

        buttonActions.UpdateMenuButtonsInteractivity(false);

        buttonActions.ActionInProgress();
        while (clock.isTimePassing)
        {
            yield return(null);
        }
        buttonActions.ActionFinished();

        if (!clock.actionCancelFlag)
        {
            bodyPart.GetComponent <BodyPart>().blood += blood;
            MonoBehaviour.FindObjectOfType <ActionTracker>().blood_injected += blood;
            GameObject.FindObjectOfType <GoldTracker>().goldSpent           += goldCost;
            buttonActions.SelectBloodAction();
        }
        else
        {
            clock.actionCancelFlag = false;
        }
    }
Esempio n. 2
0
    public static IEnumerator RemoveOrganCoroutine(Organ organ, float seconds, int goldCost, float bloodLossRateInduced, float damageInduced)
    {
        Clock clock = MonoBehaviour.FindObjectOfType <Clock>();

        clock.StartClockUntil(seconds);

        ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>();

        buttonActions.UpdateMenuButtonsInteractivity(false);

        buttonActions.ActionInProgress();
        while (clock.isTimePassing)
        {
            RemoveOrganDuring(organ, clock, seconds, bloodLossRateInduced, damageInduced);
            yield return(null);
        }
        buttonActions.ActionFinished();

        if (!clock.actionCancelFlag)
        {
            RemoveOrganProcess(organ);
            GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost;
            buttonActions.SelectSurgeryAction();
        }
    }
Esempio n. 3
0
    public static IEnumerator DeleteBodyPartCoroutine(BodyPart bodyPart, float seconds, int goldCost)
    {
        Clock clock = MonoBehaviour.FindObjectOfType <Clock>();

        clock.StartClockUntil(seconds);

        ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>();

        buttonActions.UpdateMenuButtonsInteractivity(false);

        buttonActions.ActionInProgress();
        while (clock.isTimePassing)
        {
            yield return(null);
        }
        buttonActions.ActionFinished();
        if (!clock.actionCancelFlag)
        {
            DeleteBodyPartProcess(bodyPart);
            GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost;
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection();
            }
            buttonActions.SelectSurgeryAction();
        }
    }
Esempio n. 4
0
    public static IEnumerator ConnectBodyPartCoroutine(BodyPart bodyPart1, BodyPart bodyPart2, float seconds, int goldCost, float bloodLossRateInduced, float damageInduced)
    {
        Clock clock = MonoBehaviour.FindObjectOfType <Clock>();

        clock.StartClockUntil(seconds);

        ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>();

        buttonActions.UpdateMenuButtonsInteractivity(false);

        buttonActions.ActionInProgress();
        while (clock.isTimePassing)
        {
            ConnectBodyPartDuring(bodyPart1, bodyPart2, clock, seconds, bloodLossRateInduced, damageInduced);
            yield return(null);
        }
        buttonActions.ActionFinished();
        if (!clock.actionCancelFlag)
        {
            ConnectBodyPartProcess(bodyPart1, bodyPart2);
            GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost;
            MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection();
            buttonActions.SelectSurgeryAction();
        }
    }
Esempio n. 5
0
 public void OnPointerClick(PointerEventData eventData)
 {
     buttonActions.selectedGameObject = bodyPart.gameObject;
     bodyPartSelectorManager.ResetSelectors();
     embeddedObjectSelectorManager.ResetSelectors();
     buttonActions.ClearAllButtons();
     buttonActions.UpdateMenuButtonsInteractivity(false);
 }
Esempio n. 6
0
    public void OnPointerClick(PointerEventData eventData)
    {
        buttonActions.selectedGameObject = embeddedObject.gameObject;
        embeddedObjectSelectorManager.ResetSelectors();
        FindObjectOfType <BodyPartSelectorManager>().ResetSelectors();

        buttonActions.ClearAllButtons();
        buttonActions.UpdateMenuButtonsInteractivity(false);
        borderHighlight.enabled = ShouldBeHighlighted(embeddedObject);
    }