Пример #1
0
 public void Activate(RhymeButton rhymeButton)
 {
     if (rhymeButton.rhymeLine != null)
     {
         text.text   = rhymeButton.rhymeLine.text;
         image.color = halfWhite;
     }
     else
     {
         text.text   = "EMPTY";
         image.color = halfGray;
     }
     visual.SetActive(true);
 }
    void Start()
    {
        List <RhymeButton> tempButtonList = new List <RhymeButton> ();
        RhymeButton        clone          = buttonPrototype.GetComponent <RhymeButton> ();

        clone.rhymeLine = null;
        tempButtonList.Add(clone);
        for (int x = 1; x < numberOfLinesInSong; x++)
        {
            clone           = Instantiate(buttonPrototype, notebookParent).GetComponent <RhymeButton> ();
            clone.rhymeLine = null;
            tempButtonList.Add(clone);
        }
        lines = tempButtonList.ToArray();

        foreach (RhymeLine rl in GameUtility.rhymeLines)
        {
            Instantiate(buttonPrototype, libraryParent).GetComponent <RhymeButton> ().rhymeLine = rl;
        }
    }