Exemplo n.º 1
0
 public void SetCell(JsonData _jsonData)
 {
     jsonData       = _jsonData;
     cellId         = GetJsonData("id", -1);
     cellFatherId   = GetJsonData("fatherId", -1);
     cellType       = GetJsonData("type", -1);
     isGirl         = GetJsonData("isGirl", -1);
     isUncle        = GetJsonData("isUncle", 0);
     cellName       = GetJsonData("cellName");
     cellText       = GetJsonData("cellText");
     cellLeftId     = GetJsonData("leftId", -1);
     cellRightId    = GetJsonData("rightId", -1);
     inputName.text = cellName;
     inputText.text = cellText;
     leftText       = GetJsonData("leftText");
     rightText      = GetJsonData("rightText");
     if (cellType == 30)
     {
         inputLeftText.text  = leftText;
         inputRightText.text = rightText;
     }
     cellPosX = GetJsonData("cellPosX", 60.0f);
     cellPosY = GetJsonData("cellPosY", 60.0f);
     this.transform.position = new Vector2(cellPosX, cellPosY);
     if (isGirl == 0)
     {
         isADaughter(true);
     }
     else if (isGirl == 2)
     {
         beLeave();
     }
     if (cellId == 0)
     {
         isADaughter(true);
     }
     if (cellType <= 2)
     {
         this.GetComponent <CellScript>().inputName.GetComponent <Image>().color = new Color(cellColors[cellType, 0], cellColors[cellType, 1], cellColors[cellType, 2]);
         this.GetComponent <CellScript>().inputText.GetComponent <Image>().color = new Color(cellColors[cellType, 0], cellColors[cellType, 1], cellColors[cellType, 2]);
     }
     if (cellLeftId != -1 && cellType <= 2 || cellType == 4 || isUncle == 1)
     {
         this.GetComponent <CellScript>().buttonRight.SetActive(false);
     }
     if (isUncle == 1)
     {
         this.GetComponent <CellScript>().lineNephew.gameObject.SetActive(true);
     }
     countScript = GameObject.Find("PanelCount").GetComponent <CountScript>();
     countScript.addCellCount(cellType, 1);
     if (JsonEdit.cellLoadNum >= 0)
     {
         JsonEdit.cellLoadNum++;
     }
 }
Exemplo n.º 2
0
 public void SetCountDown()
 {
     counts = GameObject.Find("CountDownManager").GetComponent <CountScript>();
     counts.CounterDownDone = true;
 }