Example #1
0
    public virtual void CreateBlock(GridNode node, Vector3 rotation)
    {
        if (node == null)
        {
            return;
        }
        Quaternion rot = Quaternion.Euler(rotation);

        LastCreatedBlock      = Instantiate(BlockObject, node.center, rot);
        LastCreatedBlock.name = CreateRandomName(8);
        node.block            = LastCreatedBlock;
        node.blockHealth      = LastCreatedBlock.GetComponent <BlockHealth>();
        node.blockHealth.SetGridBlock(node);
    }
Example #2
0
    public virtual void CreateBlock(GridNode node, Vector3 rotation)
    {
        if (node == null)
        {
            return;
        }
        Quaternion rot = Quaternion.Euler(rotation);

        LastCreatedBlock      = Instantiate(BlockObject, node.center, rot);
        LastCreatedBlock.name = UnityEngine.Random.Range(-1000, 1000).ToString();
        node.block            = LastCreatedBlock;
        node.blockHealth      = LastCreatedBlock.GetComponent <BlockHealth>();
        node.blockHealth.SetGridBlock(node);
    }