public override void InitGameController(Puzzle02Window P02W) { Debug.Log("Init GameController Puzzle02"); base.InitGameController(); Debug.Log("Connect Puzzle02 Window"); this.P02W = P02W; Debug.Log("Connect Database of Puzzle02"); DBP02 = GetComponent <DatabasePuzzle02>(); Debug.Log("Call Database of Puzzle02 to connect"); DBP02.InitDatabase(); //GR = GameObject.FindGameObjectWithTag("").GetComponent<GameRoot>(); player = GameObject.FindGameObjectWithTag("Player"); startPosition = player.transform.position; //Show Dialogue once if (showP02_00) { FindObjectOfType <DialogueManager>().StartDialogue(resourceService.LoadConversation("Puzzle02_00")); showP02_00 = false; } cannonBarrel.gameObject.SetActive(false); trailMaterial = trailMaterialWrong; foreach (GameObject text in TopViewText) { text.gameObject.SetActive(false); } foreach (GameObject text in normalText) { text.gameObject.SetActive(false); } normalText[0].gameObject.SetActive(true); //stop particle effects from playing at start cannonBlast.GetComponent <ParticleSystem>().playOnAwake = false; maincannonText.gameObject.GetComponent <TextMesh>().text = "0\n0"; Matrix = P02W.Matrix; Vector = P02W.Vector; shipImages = P02W.shipImages; SetActive(endportal, false); }
// Start is called before the first frame update void Start() { text.gameObject.GetComponent <TextMesh>().color = Color.black; brackets.gameObject.GetComponent <TextMesh>().color = Color.black; GCP02 = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControllerPuzzle02>(); DBP02 = GameObject.FindGameObjectWithTag("GameController").GetComponent <DatabasePuzzle02>(); DBP02.InitDatabase(); transform.values = new int[] { 0, 0, 0, 0 }; transform.values = DBP02.transforms0[index].values; Debug.Log("Matrix" + index + ": " + transform.values[0] + ", " + transform.values[1] + ", " + transform.values[2] + ", " + transform.values[3]); text.GetComponent <TextMesh>().text = "" + transform.values[0] + " " + transform.values[1] + "\n" + transform.values[2] + " " + transform.values[3]; }