Exemplo n.º 1
0
        public CQ_Content.Value ComputeValue(CQ_Content content)
        {
            content.InStack(this);

            if (_listParam != null && _listParam.Count > 0)
            {
                CQ_Content.Value v   = _listParam[0].ComputeValue(content);
                object           val = v.value;
                if ((Type)value_type == typeof(CQ_Type_Var.var))
                {
                    if (v.type != null)
                    {
                        value_type = v.type;
                    }
                }
                else if (v.type != value_type)
                {
                    val = content.environment.GetType(v.type).ConvertTo(content, v.value, value_type);
                }

                content.DefineAndSet(value_name, value_type, val);
            }
            else
            {
                content.Define(value_name, value_type);
            }
            //设置环境变量为
            content.OutStack(this);

            return(null);
        }
Exemplo n.º 2
0
        public CQ_Value ComputeValue(CQ_Content content)
        {
#if CQUARK_DEBUG
            content.InStack(this);
#endif
            if (__expressions != null && __expressions.Count > 0)
            {
                CQ_Value v   = __expressions[0].ComputeValue(content);
                object   val = v.value;
                if ((Type)value_type == typeof(Type_Var.var))
                {
                    if (v.type != null)
                    {
                        value_type = v.type;
                    }
                }
                else if (v.type != value_type)
                {
                    val = v.ConvertTo(value_type);
                }

                content.DefineAndSet(value_name, value_type, val);
            }
            else
            {
                content.Define(value_name, value_type);
            }
#if CQUARK_DEBUG
            content.OutStack(this);
#endif
            return(null);
        }
Exemplo n.º 3
0
        public CQ_Value ComputeValue(CQ_Content content)
        {
#if CQUARK_DEBUG
            content.InStack(this);
#endif
            if (__expressions != null && __expressions.Count > 0)
            {
                CQ_Value v = __expressions[0].ComputeValue(content);
                //object val = v.GetValue();
                //if((Type)value_type == typeof(Type_Var.var)) {
                //    if(!v.TypeIsEmpty)
                //        value_type = v.typeBridge;

                //}
                //else if(v.typeBridge != value_type) {
                //    val = v.ConvertTo(value_type);

                //}

                content.DefineAndSet(value_name, value_type, v);
            }
            else
            {
                content.Define(value_name, value_type);
            }
#if CQUARK_DEBUG
            content.OutStack(this);
#endif
            return(CQ_Value.Null);
        }
Exemplo n.º 4
0
        public IEnumerator CoroutineCompute(CQ_Content content, ICoroutine coroutine)
        {
#if CQUARK_DEBUG
            content.InStack(this);
#endif
            if (__expressions != null && __expressions.Count > 0)
            {
                if (__expressions[0].hasCoroutine)
                {
                    yield return(coroutine.StartNewCoroutine(CoroutineCompute(content, coroutine)));
                }
                else
                {
                    CQ_Value v   = __expressions[0].ComputeValue(content);
                    object   val = v.value;
                    if ((Type)value_type == typeof(Type_Var.var))
                    {
                        if (v.type != null)
                        {
                            value_type = v.type;
                        }
                    }
                    else if (v.type != value_type)
                    {
                        val = v.ConvertTo(value_type);
                    }

                    content.DefineAndSet(value_name, value_type, val);
                }
            }
            else
            {
                content.Define(value_name, value_type);
            }
#if CQUARK_DEBUG
            content.OutStack(this);
#endif
        }
Exemplo n.º 5
0
        public IEnumerator CoroutineCompute(CQ_Content content, ICoroutine coroutine)
        {
            content.InStack(this);

            if (_listParam != null && _listParam.Count > 0)
            {
                if (_listParam[0].hasCoroutine)
                {
                    yield return(coroutine.StartNewCoroutine(CoroutineCompute(content, coroutine)));
                }
                else
                {
                    CQ_Content.Value v   = _listParam[0].ComputeValue(content);
                    object           val = v.value;
                    if ((Type)value_type == typeof(CQ_Type_Var.var))
                    {
                        if (v.type != null)
                        {
                            value_type = v.type;
                        }
                    }
                    else if (v.type != value_type)
                    {
                        val = content.environment.GetType(v.type).ConvertTo(content, v.value, value_type);
                    }

                    content.DefineAndSet(value_name, value_type, val);
                }
            }
            else
            {
                content.Define(value_name, value_type);
            }
            //设置环境变量为
            content.OutStack(this);
        }
Exemplo n.º 6
0
        public IEnumerator CoroutineCompute(CQ_Content content, UnityEngine.MonoBehaviour coroutine)
        {
#if CQUARK_DEBUG
            content.InStack(this);
#endif
            if (__expressions != null && __expressions.Count > 0)
            {
                if (__expressions[0].hasCoroutine)
                {
                    yield return(coroutine.StartCoroutine(CoroutineCompute(content, coroutine)));
                }
                else
                {
                    CQ_Value v = __expressions[0].ComputeValue(content);
                    //object val = v.GetValue();
                    //if((Type)value_type == typeof(Type_Var.var)) {
                    //    if(!v.TypeIsEmpty)
                    //        value_type = v.typeBridge;

                    //}
                    //else if(v.typeBridge != value_type) {
                    //    val = v.ConvertTo(value_type);

                    //}

                    content.DefineAndSet(value_name, value_type, v);
                }
            }
            else
            {
                content.Define(value_name, value_type);
            }
#if CQUARK_DEBUG
            content.OutStack(this);
#endif
        }