// Use this for initialization void Start() { this.transform.Find("Model3D").Find("Eye").gameObject.SetActive(false); pivot = transform.Find("Pivot"); inf = this.GetComponent <Informer>(); ask = this.GetComponent <Asker>(); sol = this.GetComponent <Solutioner>(); ul = this.GetComponent <Unlocker>(); inq = this.GetComponent <Inquisitor>(); if (sol != null) { message.transform.Find("Text").GetComponent <TextMesh>().text = sol.answer; } this.name = data.name; message.SetActive(false); }
public void chooseThis() { near = true; if (chosen != null) { StatueControl statue = chosen.GetComponent <StatueControl>(); chosen.transform.Find("Model3D").Find("Shine").GetComponent <MeshRenderer>().material.color = statue.offColor; statue.message.SetActive(false); } this.transform.Find("Model3D").Find("Shine").GetComponent <MeshRenderer>().material.color = chosenColor; chosen = this.GetComponent <Solutioner>(); if (places.Length > 0) { places[0].turnOn(); } }
public void getAnswer() { if (!waitAnswer) //first time talking to player { for (int i = 0; i < GameManager.instance.activedPuzzles[id].solutions.Length; i++) { GameManager.instance.activedPuzzles[id].solutions[i].locked = false; //unlock all solution statues Solutioner s = GameManager.instance.activedPuzzles[id].solutions[i].GetComponent <Solutioner>(); if (s.places.Length > 0) { foreach (ItemPlace ip in s.places) { ip.setOp(); //if have itens, set place options } } } waitAnswer = true; } else { if (Solutioner.chosen == null) //not have answer { myStatue.myBallon.transform.Find("Text").GetComponent <Text>().text = emptyMsg; } else if (Solutioner.chosen.answer == GameManager.instance.activedPuzzles[id].answer) { myStatue.myBallon.transform.Find("Text").GetComponent <Text>().text = correctMsg; GameManager.loadGameScene(nextScene); } else { myStatue.myBallon.transform.Find("Text").GetComponent <Text>().text = wrongMsg; Debug.Log(Solutioner.chosen.answer); } } }
// Use this for initialization void Start() { statue = this.transform.parent.GetComponent <Solutioner>(); aux = new List <Dropdown.OptionData>(); offset = ((index % statue.places.Length) - (statue.places.Length - 1) / 2) * 50.0f; }