Пример #1
0
    protected GameObject GenerateNextEarth(GameObject currentBlock)
    {
        Storage.CountBlockEarth--;
        GameBlock  block    = MessageSystemGameBlock.ReturnDisactiveDownEarth();
        GameObject newBlock = block.GetGameObject();

        block.SetActiveFull(true);
        float         deltaMinus = -0.065f;
        BoxCollider2D curBox     = currentBlock.GetComponent <BoxCollider2D>();
        BoxCollider2D newBox     = newBlock.GetComponent <BoxCollider2D>();
        float         delta      = curBox.bounds.extents.x + newBox.bounds.extents.x + deltaMinus;

        newBlock.transform.position = new Vector3(curBox.bounds.center.x + delta, newBlock.transform.position.y, newBlock.transform.position.z);
        MessageSystemGameBlock.SetupParent(newBlock, false);
        return(newBlock);
    }