Exemplo n.º 1
0
 public void CreateNode()
 {
     if (Object.op_Equality((Object)this.m_Node, (Object)null))
     {
         Debug.LogError((object)("ベースノードが設定されていません > " + ((Object)((Component)this).get_gameObject()).get_name()));
     }
     else
     {
         this.DestroyNode();
         int nodeWidthNum  = this.m_NodeWidthNum;
         int nodeHeightNum = this.m_NodeHeightNum;
         if (this.isScrollHorizontal)
         {
             nodeWidthNum += 2;
         }
         if (this.isScrollVertical)
         {
             nodeHeightNum += 2;
         }
         for (int index1 = 0; index1 < nodeHeightNum; ++index1)
         {
             for (int index2 = 0; index2 < nodeWidthNum; ++index2)
             {
                 ContentNode contentNode = (ContentNode)null;
                 if (this.m_Source != null)
                 {
                     contentNode = this.m_Source.Instantiate(this.m_Node);
                 }
                 else
                 {
                     GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)((Component)this.m_Node).get_gameObject());
                     if (Object.op_Inequality((Object)gameObject, (Object)null))
                     {
                         contentNode = (ContentNode)gameObject.GetComponent <ContentNode>();
                     }
                 }
                 if (Object.op_Inequality((Object)contentNode, (Object)null))
                 {
                     contentNode.Initialize(this);
                     ((Component)contentNode).get_gameObject().get_transform().SetParent((Transform)this.m_RectTransform, false);
                     ((Component)contentNode).get_gameObject().SetActive(false);
                     this.m_NodeEmpty.Add(contentNode);
                 }
             }
         }
         this.UpdateNode();
         this.m_SelectNode = -1;
     }
 }
Exemplo n.º 2
0
 public void CreateStaticNode(List <ContentNode> list)
 {
     this.DestroyNode();
     for (int index = 0; index < list.Count; ++index)
     {
         ContentNode contentNode = list[index];
         int         x           = index % this.m_ViewWidthNum;
         int         y           = index / this.m_ViewWidthNum;
         int         paramIndex  = this.GetParamIndex(x, y);
         contentNode.Initialize(this);
         contentNode.Setup(paramIndex, x, y, this.GetParam(paramIndex));
         this.m_NodeUsed.Add(this.GetNodeKey(x, y), contentNode);
     }
     this.UpdateNode();
     this.m_SelectNode = -1;
 }