예제 #1
0
    /// <summary>
    /// This function sets all values and references according to the notification it is supposed to represent.
    /// No scaling happening as of now (might not fit properly)
    /// </summary>
    /// <param name="note">The notification this listItem will represent</param>
    public void SetupItem(Notification note)
    {
        m_BasicInformation.text = note.GetBasicInfo();
        m_Icon.texture          = VRUILogic.Instance.GetIconTexture(note.GetNotificationType());
        //links this item to notification
        //ensures that this list item is deleted as soon as notification is outdated
        note.AddRelatedObject(gameObject);
        m_Note = note;


        //TODO: must be set, but rect.width is zero due to automatic scaling scripts...

        //BoxCollider collider = GetComponent<BoxCollider>();
        //Rect rect = GetComponent<RectTransform>().rect;//no way to access the value found as of now... set manually
        //collider.size = new Vector3(rect.width, rect.height, 0.01f);
        //Debug.Log("UI BUTTON SIZE: " + collider.size);
    }