Пример #1
0
 public bool HasCompatibleType(IArgument argIn)
 {
     if (argIn as Variable != null)
     {
         if (CheckArgCompatibleType((argIn as Variable).GetMyData().GetType()))
         {
             return(true);
         }
     }
     return(CheckArgCompatibleType(argIn?.GetType()));
 }
        private void SetCompatibleColliderState(CodeBlock cIn, bool desiredActiveState)
        {
            IArgument internalArg = cIn.GetMyIArgument();

            foreach (SnapCollider sc in GetAllSnapColliders())
            {
                if (sc.HasCompatibleType(internalArg) && !sc.MyCodeBlock.GetIsMenuBlock())
                {
                    sc.gameObject.SetActive(desiredActiveState);
                }
            }
        }
Пример #3
0
        public int GetPositionOfArgument(IArgument iArgIn)
        {
            int index = 0;

            foreach (IArgument ia in codeBlockArgumentList.GetArgListAsIArguments())
            {
                if (ia == iArgIn)
                {
                    return(index);
                }
                ++index;
            }
            return(-1);
        }
Пример #4
0
        private int FindNextSnapIndex()
        {
            for (int actionIndex = 0; actionIndex < snapChild.Length; ++actionIndex)
            {
                Type snapArgType = ConvertToSnapColClass(snapArgs[actionIndex]);

                if (snapArgs[actionIndex] != SNAPARGTYPES.REMOVE)
                {
                    IArgument ia = snapParent[actionIndex].GetArgumentFromDict(new KeyValuePair <Type, int>(snapArgType, 0));
                    if (ia == null)
                    {
                        return(actionIndex);
                    }
                }
                else
                {
                    if (snapChild[actionIndex].FindParentCodeBlock() == snapParent[actionIndex])
                    {
                        return(actionIndex);
                    }
                }
            }
            return(-1);
        }