Exemplo n.º 1
0
    public void TriggerLevelSimulation(LinkJava.SimulationFeedback feedback)
    {
        LinkJava.OnSimulationCompleted -= TriggerLevelSimulation;

        PlayerInteraction_GamePhaseBehavior castBehavior = (PlayerInteraction_GamePhaseBehavior)playerInteractionBehavior;

        //none indicates hitting the replay button
        if (feedback != LinkJava.SimulationFeedback.none)
        {
            //Debug.Log("Feedback from LinkJava to GameManager was " + feedback.ToString());
            castBehavior.StartSimulation();
        }

        if (feedback == LinkJava.SimulationFeedback.success || feedback == LinkJava.SimulationFeedback.none)
        {
            castBehavior.StartSimulation();
        }

        else if (feedback == LinkJava.SimulationFeedback.failure)
        {
            castBehavior.playerInteraction_UI.loadingOverlay.ClosePanel();
            PlayerInteraction_GamePhaseBehavior playerInteraction = playerInteractionBehavior as PlayerInteraction_GamePhaseBehavior;
            playerInteraction.EndSimulation();
            castBehavior.playerInteraction_UI.simulationErrorOverlay.OpenPanel();
        }
    }
    public void TriggerLevelSimulation(LinkJava.SimulationFeedback feedback)
    {
        LinkJava.OnSimulationCompleted -= TriggerLevelSimulation;

        //none indicates hitting the replay button
        if (feedback != LinkJava.SimulationFeedback.none)
        {
            Debug.Log("Feedback from LinkJava to GameManager was " + feedback.ToString());
        }

        PlayerInteraction_GamePhaseBehavior castBehavior = (PlayerInteraction_GamePhaseBehavior)playerInteractionBehavior;

        if (feedback == LinkJava.SimulationFeedback.success)
        {
            castBehavior.StartSimulation();
        }
        else
        {
            castBehavior.playerInteraction_UI.simulationErrorOverlay.OpenPanel();
        }
    }