EndState Conditions
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class EndSceneConsequences : MonoBehaviour
{
string displayString;
string newLine = System.Environment.NewLine;
[SerializeField]
Text resultText;
// Start is called before the first frame update
void Start()
{
UpdateDisplay(); //make sure this is executed before the NCPActivation in build settings
}
void UpdateDisplay()
{
string zombieState = GameData.instanceRef.GetChoice("ZombieState");
string robotState = GameData.instanceRef.GetChoice("RobotState");
if( zombieState=="companion" && robotState == "companion")
{
displayString = "Congratulations: You are Enlightened." + newLine + "Because you have 2 companions, your beloved cat snowball is safe." + newLine + "Helping others also helped you.";
GameData.instanceRef.SaveChoice("CatState", "companion");
GameData.instanceRef.SaveChoice("LucyState", "enlightened");
GameData.instanceRef.SaveChoice("MonsterState", "subdued");
}
else
{
displayString = "Oh my, Snowball has been captured by the villian Mr Big, you will need several companions to help rescue snowball";
}
resultText.text = displayString;
}
}
Last updated