public override void Interact(PlayerStamina playerStamina) { CreateTextbox.Create(Name, Text + "\nThis costs <color=blue>" + price + " gems</color>."); CreateTextbox.Create(Name, new string[] { "Buy", "Cancel" }, true, true, selection => { switch (selection) { // Buy case 0: if (playerStamina.Gems >= price) { if (playerStamina.HasItem) { CreateTextbox.Create(Name, "You're already holding an item..."); } else { playerStamina.AddGems(-price); playerStamina.Item = item; CreateTextbox.Create(Name, "Come again!"); } } else { CreateTextbox.Create(Name, "You don't have enough <color=blue>gems</color>..."); } break; // Cancel case 1: CreateTextbox.Create(Name, "Come again!"); break; } }); }
public void OnOpen(PlayerStamina player) { if (!open) { player.AddGems(gems); open = true; GetComponent <MeshFilter>().mesh = openMesh; Material material = GetComponent <MeshRenderer>().material; material.SetTexture("_MainTex", openTex); material.SetTexture("_BumpMap", openMap); CreateTextbox.Create("Chest", "You found <color=blue>" + gems.ToString() + " gems</color>!"); Opened(); } }
void OnTriggerEnter(Collider collider) { if (collider.gameObject.CompareTag("Hazard")) { StartCoroutine("Die"); } if (collider.gameObject.CompareTag("Trap")) { if (!hasTrapped) { CreateTextbox.Create("You", "You fell into a trap! <color=blue>Shake the tablet</color> to escape."); hasTrapped = true; } playerMove.Trapped = true; Destroy(collider.gameObject); } if (collider.gameObject.CompareTag("TextTrigger")) { CreateTextbox.Close(); Destroy(collider.gameObject); } if (collider.gameObject.CompareTag("FinalTrigger")) { GameObject.Find("Pyramid").GetComponent <PyramidController>().FinalText(); Destroy(collider.gameObject); } if (collider.gameObject.CompareTag("Door")) { CreateTextbox.Create("You", "Would you like to leave the tutorial?", false, true, result => CreateTextbox.Create("You", new string[] { "Leave", "Stay" }, true, true, answer => { switch (answer) { // Leave case 0: Application.Quit(); break; // Stay case 1: CreateTextbox.Clear(); break; } })); } }
void Start() { // Get list of markers markers = new List <GameObject>(FindObjectsOfType <GameObject>()); markers.RemoveAll(gameObj => gameObj.CompareTag("PyramidMarker") == false); // Sort markers by distance markers.Sort(new MarkerComparer(transform.position)); CreateTextbox.Create("Pyramid", "Welcome to my Dungeon of Doom! First things first. <color=blue>Tap the screen</color> to move around. You only need a tap, no need to hold it down.", false, false, answer => NextMarker()); CreateTextbox.Create("Pyramid", "Hmm. The ball shows some promise. But I bet you'll never figure out you can <color=blue>press Z to jump</color> up these platforms!", false, false, answer => NextMarker()); CreateTextbox.Create("Pyramid", "Excellent. I wonder if you realise you can perform <color=blue>wall jumps</color> by jumping into a wall, then <color=blue>jumping again</color>...", false, false, answer => NextMarker()); CreateTextbox.Create("Pyramid", "Did I mention that you can roll? <color=blue>Press X to roll</color> forward quickly. You'll need to use it after hitting this switch. Oh, and try not to die.", false, false, answer => NextMarker()); CreateTextbox.Create("Pyramid", "Very clever. You're probably feeling mighty proud of yourself, and after all that hard work, you deserve a reward. <color=blue>Press X to open</color> this chest.", false, true, answer => NextMarker()); }
public virtual void Interact(PlayerStamina playerStamina) { CreateTextbox.Create(Name, Text); }
public void FinalText() { CreateTextbox.Create("Pyramid", "Well, I'm getting bored of following you around like this, so you will have to continue alone. Fear not, I will be watching intently...", false, true); }