示例#1
0
    public void load(int index)
    {
        blockIndex = index;
        if (!serialization.isDeletable(index))
        {
            deleteButton.interactable = false;
        }

        GameObject buffer = BlockDeserialization.CreateBlock(blockIndex, BlockDeserialization.createMode.NOSCRIPT);

        buffer.transform.SetParent(block.transform);
        buffer.transform.localPosition = new Vector3();
        buffer.transform.localScale    = new Vector3(1, 1, 1);
    }
示例#2
0
    public void randNew()
    {
        if (transform.childCount > 0)
        {
            foreach (Transform obj in transform)
            {
                Destroy(obj.gameObject);
            }
        }
        int index = Random.Range(0, serialization.blockCount());

        GameObject buffer = BlockDeserialization.CreateBlock(index, BlockDeserialization.createMode.STANDARD);

        buffer.transform.SetParent(transform);
        buffer.transform.localPosition = new Vector2(0, 0);
        buffer.transform.localScale    = new Vector3(0.5f, 0.5f, 0.5f);

        buffer.GetComponent <Block>().randColor();
        buffer.GetComponent <Block>().enabled = false;
    }