Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (Player)
     {
         if (CurBlock.GetComponent <DetectCliks> ())
         {
             if (!CurBlock.GetComponent <DetectCliks> ().GetStickInst())
             {
                 if (Player.GetComponent <MovePlayer> ().GetIsWin())
                 {
                     if (!OnPlace)
                     {
                         if ((CurBlock.GetComponent <SpawnBlock> ().GetblockInstNext().transform.position.x + CurBlock.GetComponent <SpawnBlock> ().GetblockInstNext().transform.localScale.x / 2 > Pos))
                         {
                             DoneToSpawn = false;
                             AllBlocks.transform.Translate(new Vector3(-0.05f, 0f, 0f));
                             Player.transform.Translate(new Vector3(-0.05f, 0f, 0f));
                             IsMoved = true;
                         }
                         else
                         {
                             //AllBlocks.transform.position
                             //CurBlock.GetComponent<SpawnBlock> ().GetblockInstNext().transform.position = new Vector3 (Pos, CurBlock.GetComponent<SpawnBlock> ().GetblockInstNext ().transform.position.y
                             //, CurBlock.GetComponent<SpawnBlock> ().GetblockInstNext ().transform.position.z);
                             IsMoved     = false;
                             DoneToSpawn = true;
                             Player.GetComponent <MovePlayer> ().SetIsReadyToSpawn(true);
                             OnPlace = true;
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
    public override IEnumerator FallDown()
    {
        for (; ;)
        {
            CurBlock.DownMove();

            CoordGrid(); // 서버 전송용 배열로 변환
            IncodeGridInfo();

            OtherGridUpdate();

            yield return(new WaitForSeconds(0.5f));
        }
    }