public void loadMoveButton(DetailsMoveButt details) { if (audioPlayer.isPlaying) { audioPlayer.Stop(); } destroyPanelChildren(); placeAllNewButtons(details); bindButtons(); }
void placeNewGoInsideButtons(DetailsMoveButt callingMButtonDetails) { this.goInsideButtons = new Button[callingMButtonDetails.myGoInsideButtons.Length]; for (int i = 0; i < callingMButtonDetails.myGoInsideButtons.Length; i++) { DetailsGoInsideButt gDetails = callingMButtonDetails.myGoInsideButtons[i].GetComponent <DetailsGoInsideButt>(); if (directionalPanels.transform.Find(gDetails.myPanel) != null) { Transform panel = directionalPanels.transform.Find(gDetails.myPanel); GameObject newButton = Instantiate(callingMButtonDetails.myGoInsideButtons[i], panel.position, panel.rotation); newButton.transform.SetParent(panel); newButton.transform.Translate(new Vector3(gDetails.xOffset, gDetails.yOffset)); this.goInsideButtons[i] = newButton.GetComponent <Button>(); } else { Debug.Log("A goInside button was not properly assigned to a panel"); } } }
void placeAllNewButtons(DetailsMoveButt callingMButtonDetails) { placeNewMoveButtons(callingMButtonDetails); placeNewInfoButtons(callingMButtonDetails); placeNewGoInsideButtons(callingMButtonDetails); }
public void changeTexture(DetailsMoveButt details) { rend.material.mainTexture = details.myToTexture; }