示例#1
0
        void NotificationTest()
        {
            // Get custom struct from manager
            var data = m_PopUpManager.GetNotificationData();

            // The Notification has an icon and a different default position
            bool hasIcon = (Random.value > 0.5f && m_Icons != null && m_Icons.Length > 0);
            var  icon    = hasIcon ? m_Icons[Mathf.FloorToInt(Random.value * 10e3f) % m_Icons.Length] : null;

            data.icon = icon;
            data.text = "Notification text";

            // Send back the modified struct
            m_PopUpManager.DisplayNotification(data);
        }