Exemple #1
0
 public void SpawnButtons(materialChanger obj)
 {
     for (int i = 0; i < obj.materials.Length; i++)
     {
         radialButton newButton = Instantiate(buttonPrefab) as radialButton;
         newButton.transform.SetParent(transform.GetChild(0));
         //newButton.transform.localScale = n
     }
 }
Exemple #2
0
 // Use this for initialization
 public void SpawnButtons(interactable obj)
 {
     for (int i = 0; i < obj.options.Length; i++)
     {
         objTemp = obj;
         radialButton newButton = Instantiate(buttonPrefab) as radialButton;
         newButton.transform.SetParent(transform, false);
         float theta = (2 * Mathf.PI / obj.options.Length) * i;
         float xPos  = Mathf.Sin(theta);
         float yPos  = Mathf.Cos(theta);
         newButton.transform.localPosition = new Vector3(xPos, yPos, 0f) * 100f;
         newButton.circle.color            = obj.options[i].color;
         newButton.icon.sprite             = obj.options[i].sprite;
         newButton.title  = obj.options[i].title;
         newButton.myMenu = this;
     }
 }