예제 #1
0
 void Awake()
 {
     block         = gameObject.GetComponent <Block>();
     block.addable = true;
     GP            = GameObject.Find("Script").GetComponent <GPCtrlr>();
     x             = GP.lx;
     y             = GP.ly;
     transform.SetPositionAndRotation(new Vector3((float)(-1.5 + x), (float)(-1.56 + y), 0f), new Quaternion());
     gameObject.name = x.ToString() + y.ToString();
     GP.blocks[x, y] = true;
     gameObject.GetComponent <SpriteRenderer>().sprite = GP.sprites[GP.blockspritenum[x, y]];
 }
예제 #2
0
파일: Block.cs 프로젝트: RedDeadAlice/512
 void Start()
 {
     startBlock = gameObject.GetComponent <StartBlock>();
     GP         = GameObject.Find("Script").GetComponent <GPCtrlr>();
     if (gameObject.GetComponent <StartBlock>() != null)
     {
         startBlock = gameObject.GetComponent <StartBlock>();
         x          = startBlock.x;
         y          = startBlock.y;
     }
     else
     {
         loadBlock = gameObject.GetComponent <LoadBlock>();
         x         = loadBlock.x;
         y         = loadBlock.y;
     }
 }
예제 #3
0
    void Awake()
    {
        transform.localScale = new Vector3(0, 0);
        block         = gameObject.GetComponent <Block>();
        block.addable = true;
        GP            = GameObject.Find("Script").GetComponent <GPCtrlr>();
        x             = Random.Range(0, 4);
        y             = Random.Range(0, 4);
        if (GP.blocks[x, y] != false)
        {
            Awake();
        }

        transform.SetPositionAndRotation(new Vector3((float)(-1.5 + x), (float)(-1.56 + y), 0f), new Quaternion());
        gameObject.name = x.ToString() + y.ToString();
        GP.blocks[x, y] = true;
        int twoorfour = Random.Range(0, 2);

        GP.blockspritenum[x, y] = twoorfour;
        gameObject.GetComponent <SpriteRenderer>().sprite = GP.sprites[GP.blockspritenum[x, y]];
    }