Ejemplo n.º 1
0
        public void RemoveFromParentBlock(bool humanDidIt)
        {
            CodeBlock parentCodeBlock = FindParentCodeBlock();

            if (parentCodeBlock != null)
            {
                parentCodeBlock.SetArgumentBlockAt(null, parentCodeBlock.GetPositionOfArgument(GetMyInternalIArgument()), humanDidIt);
            }
        }
Ejemplo n.º 2
0
        // TODO: humanDidIt is such a hack
        public void DoSnapAction(CodeBlock myCodeBlock, CodeBlock collidedCodeBlock, bool humanDidIt = true)
        {
            Transform parentTransform = transform.parent;

            myCodeBlock.SetArgumentBlockAt(collidedCodeBlock, myArgumentPosition, humanDidIt);
            Vector3 centerPos = collidedCodeBlock.GetCodeBlockObjectMesh().GetCenterPosition();

            centerPos.x = centerPos.x / parentTransform.localScale.x;
            collidedCodeBlock.transform.SnapToParent(parentTransform, snapPosition - centerPos);
        }