Beispiel #1
0
    /// <summary>
    /// 树节点初始化
    /// </summary>
    protected virtual void InitAwakeItem()
    {
        icon.GetComponent <Button>().onClick.AddListener(() =>
        {
            if (this.itemClick != null)
            {
                this.itemClick(this.treeData);
            }
            if (this.treeData.expand)
            {
                icon.rectTransform.localRotation = Quaternion.Euler(0, 0, -90);
            }
            else
            {
                icon.rectTransform.localRotation = Quaternion.Euler(0, 0, 0);
            }
        });

        text.GetComponent <Button>().onClick.AddListener(() =>
        {
            Debug.Log("点击信息:" + this.treeData.name + " " + this.treeData.id);

            if (ClickItemManager.Instance.AllClickItem.ContainsKey(treeData.id))
            {
                ClickItemInfo clickite = ClickItemManager.Instance.AllClickItem[treeData.id];
                clickite.MoveTo();
            }
            else
            {
                Debug.LogError("未配置");
            }
        });
    }
Beispiel #2
0
    /// <summary>
    /// 解析Json类型1
    /// </summary>
    private void AnysicsOne()
    {
        m_TestJsonClass = JsonMapper.ToObject <one>(m_RecvMsg);
        //唯一ID
        string id = m_TestJsonClass.ID;

        if (ClickItemManager.Instance.AllClickItem.ContainsKey(id))
        {
            ClickItemInfo clickite = ClickItemManager.Instance.AllClickItem[id];
            clickite.MoveTo();
        }
        else
        {
            Debug.LogError("未配置");
        }
        //是否报警
        int isAlram = m_TestJsonClass.isAlram;

        if (AlramItemManager.Instance.AllAlramItem.ContainsKey(id))
        {
            AlarmEffect clickite = AlramItemManager.Instance.AllAlramItem[id];
            clickite.SetIsOn(isAlram);
        }
        else
        {
            Debug.LogError("未配置");
        }
    }