Esempio n. 1
0
    void Start()
    {
        m_listLayoutGroup = GetComponent <ListLayoutGroup> ();
        List <Color> list = new List <Color> ();

        for (int i = 0; i < dataLength; ++i)
        {
            list.Add(new Color((float)i / dataLength, (float)((i * 2) % dataLength) / dataLength, (float)((i * i) % dataLength) / dataLength));
        }
        m_listLayoutGroup.SetData(template, list, (i, p, d) => p.color = d);
    }
Esempio n. 2
0
        public void OnSendMessageSync(Message.CBSendMessageSync msg)
        {
            m_chatMsgs.Add(msg);

            chatMsgGroup.SetData <SosChatMessageItem, Message.CBSendMessageSync>(m_chatMsgs
                                                                                 , (index, item, data) =>
            {
                var player = GetPlayer(data.FromPlayerID).data;
                item.SetData(player, data.Content);
            });

            var tw = uTools.uTweenFloat.Begin(chatMsgGroup.gameObject, chatMsgGroup.GetScrollRect().verticalNormalizedPosition, 0, 0.2f, 0);

            tw.onUpdate = () =>
            {
                chatMsgGroup.GetScrollRect().verticalNormalizedPosition = tw.value;
            };
        }