Beispiel #1
0
 public Parameter Set(StatementBase statement)
 {
     paramType  = VarType.Void;
     _statement = statement;
     varName    = null;
     return(this);
 }
Beispiel #2
0
        public void Show(StatementBase statement)
        {
            for (int i = 0; i < paramGoPool.Count; i++)
            {
                paramGoPool[i].gameObject.SetActive(false);
            }
            for (int i = 0; i < statementGoPool.Count; i++)
            {
                statementGoPool[i].gameObject.SetActive(false);
            }
            Grammar grammar = statement.GetGrammar();
            IDEItem item;
            int     paramIndex = 0;

            for (int i = 0; i < grammar.Count; i++)
            {
                if (grammar [i].StartsWith("*Param:"))
                {
                    item    = GetPrefab(paramGo);
                    item.id = paramIndex;
                    item.SetIDEData(statement.GetParam(paramIndex));
                    paramGoPool.Add(item);
                    paramIndex++;
                }
                else
                {
                    item = GetPrefab(statementGo);
                    item.SetIDEData(grammar[i]);
                    statementGoPool.Add(item);
                }
                item.gameObject.SetActive(true);
            }
        }
        public override Parameter Execute()
        {
            StatementBase statement = GetParam(0);

            if (statement != null)
            {
                statement.Execute();
            }
            return(new Parameter());
        }
Beispiel #4
0
        public void StepIn(int index)
        {
            StatementBase state = stateStack.Peek();

            if ((StatementBase)state.GetParam(index) == null)
            {
                return;
            }
            if (!((StatementBase)state.GetParam(index)).HasParam())
            {
                return;
            }
            stateStack.Push(state.GetParam(index));
            Show(stateStack.Peek());
        }
Beispiel #5
0
        public void OnValueChange(int i)
        {
            input.gameObject.SetActive(optionCache[i].Equals("Value"));
            text.gameObject.SetActive(!input.gameObject.activeSelf);
            if (input.gameObject.activeSelf)
            {
                return;
            }
            if (optionCache[i].StartsWith("Var:"))
            {
                //param.SetVar (,);
                param.SetVar(optionCache[i].Substring(4));
                //HackStudioCode.Instance.SetParam (id,param);
                SetIDEData(param);
                return;
            }
            Type          t = Type.GetType(optionCache[i]);
            StatementBase s = (StatementBase)Activator.CreateInstance(Type.GetType(optionCache[i]));

            param.Set(s);
            HackStudioCode.Instance.SetParam(id, param);
            SetIDEData(param);
            HackStudioCode.Instance.StepIn(id);
        }