当前位置: 首页>>代码示例>>C#>>正文


C# CLS_Content.Set方法代码示例

本文整理汇总了C#中CSLE.CLS_Content.Set方法的典型用法代码示例。如果您正苦于以下问题:C# CLS_Content.Set方法的具体用法?C# CLS_Content.Set怎么用?C# CLS_Content.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSLE.CLS_Content的用法示例。


在下文中一共展示了CLS_Content.Set方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();

            CLS_Content.Value vrt = null;

            CLS_Expression_Define define = listParam[0] as CLS_Expression_Define;
            define.ComputeValue(content);

            IEnumerator it = (listParam[1].ComputeValue(content).value as IEnumerable).GetEnumerator();

            ICLS_Expression expr_block = listParam[2];

            while (it.MoveNext())
            {
                content.Set(define.value_name, it.Current);

                if (expr_block != null)
                {
                    CLS_Content.Value v = expr_block.ComputeValue(content);
                    if (v != null)
                    {
                        if (v.breakBlock > 2)
                            vrt = v;
                        if (v.breakBlock > 1)
                            break;
                    }
                }
            }
            content.DepthRemove();
            content.OutStack(this);
            return vrt;
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:34,代码来源:CLS_Expression_LoopForEach.cs

示例2: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            {
                
                CLS_Content.Value v = listParam[0].ComputeValue(content);

                        {
                            object val = v.value;
                            if (content.values.ContainsKey(value_name))
                            {
                                CLType value_type = content.values[value_name].type;

                                val = v.value;
                                if ((Type)value_type != typeof(CLS_Type_Var.var) && value_type != v.type)
                                {
                                    val = content.environment.GetType(v.type).ConvertTo(content, v.value, value_type);
                                }
                            }
                    content.Set(value_name, val);
                    }
            }
            content.OutStack(this);
            return null;
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:26,代码来源:CLS_Expression_SetValue.cs

示例3: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            CLS_Expression_Define define = listParam[0] as CLS_Expression_Define;
            if (define == null)
            {

            }
            define.ComputeValue(content);

            System.Collections.IEnumerable emu = listParam[1].ComputeValue(content).value as System.Collections.IEnumerable;

            ICLS_Expression expr_block = listParam[2] as ICLS_Expression;

            var it = emu.GetEnumerator();
            while (it.MoveNext())
            {
                content.Set(define.value_name, it.Current);

                if (expr_block != null)
                {
                    var v = expr_block.ComputeValue(content);
                    if (v != null && v.breakBlock > 1) break; ;
                }
            }
            //ICLS_Expression expr_continue = listParam[1] as ICLS_Expression;
            //ICLS_Expression expr_step = listParam[2] as ICLS_Expression;

            //ICLS_Expression expr_block = listParam[3] as ICLS_Expression;

            //for (;(bool)expr_continue.ComputeValue(content).value; expr_step.ComputeValue(content))
            //{
            //    if(expr_block!=null)
            //    {
            //        var v = expr_block.ComputeValue(content);
            //        if (v != null && v.breakBlock > 1) break; ;
            //        //if (v.breakBlock == 1) continue;
            //        //if (v.breakBlock == 2) break;
            //        //if (v.breakBlock == 10) return v;
            //    }
            //}
            content.DepthRemove();
            content.OutStack(this);
            return null;
            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
        }
开发者ID:jzgenius,项目名称:CSLightStudio,代码行数:50,代码来源:CLS_Expression_LoopForEach.cs

示例4: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            {

                CLS_Content.Value v = listParam[0].ComputeValue(content);

                {
                    object val = v.value;
                    CLType value_type = null;
                    if (content.values.ContainsKey(value_name))
                    {
                        value_type = content.values[value_name].type;
                    }
                    else
                    {
                        if (content.CallType != null)
                        {
                            if (content.CallType.members.ContainsKey(value_name))
                            {
                                if (content.CallType.members[value_name].bStatic)
                                {
                                    value_type = content.CallType.staticMemberInstance[value_name].type;
                                }
                                else
                                {
                                    value_type = content.CallThis.member[value_name].type;
                                }

                            }

                        }
                    }
                    //val = v.value;
                    if ((Type)value_type != typeof(CLS_Type_Var.var) && value_type != v.type)
                    {
                        val = content.environment.GetType(v.type).ConvertTo(content, v.value, value_type);
                    }


                    content.Set(value_name, val);
                }
            }
            content.OutStack(this);
            return null;
        }
开发者ID:qq1792,项目名称:CSLightStudio,代码行数:47,代码来源:CLS_Expression_SetValue.cs

示例5: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            var v = content.Get(value_name);
            ICLS_Type type = content.environment.GetType(v.type);
            CLType returntype;
            object value = type.Math2Value(content,mathop, v.value, CLS_Content.Value.One, out returntype);
            value = type.ConvertTo(content, value, v.type);
            content.Set(value_name, value);

            //操作变量之
            //做数学计算
            //从上下文取值
            //_value = null;
            content.OutStack(this);

            return content.Get(value_name);
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:19,代码来源:CLS_Expression_SelfOp.cs

示例6: MemberCall

        public override CLS_Content.Value MemberCall(CLS_Content content, object object_this, string function, BetterList<CLS_Content.Value> _params, bool isBaseCall = false)
        {
            CLS_Content.Value retVal = null;

            Mathf newVal = (Mathf)object_this;
            if (function == "Equals")
            {
                retVal = new CLS_Content.Value();
                retVal.type = typeof(bool);
                retVal.value = newVal.Equals(_params[0].value);
            }
            else if (function == "ToString")
            {
                retVal = new CLS_Content.Value();
                retVal.type = typeof(string);
                retVal.value = newVal.ToString();
            }
            else
                return base.MemberCall(content, object_this, function, _params, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return retVal;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return retVal;
            }

            return base.MemberCall(content, object_this, function, _params, isBaseCall);
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:37,代码来源:ToCSLightMathf.cs

示例7: MemberValueSet

        public override void MemberValueSet(CLS_Content content, object object_this, string valuename, object value, bool isBaseCall = false)
        {
            Color newVal = (Color)object_this;
            if (valuename == "a")
                newVal.a = Convert.ToSingle(value);
            else if (valuename == "b")
                newVal.b = Convert.ToSingle(value);
            else if (valuename == "g")
                newVal.g = Convert.ToSingle(value);
            else if (valuename == "r")
                newVal.r = Convert.ToSingle(value);
            else
                base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                if (content.CallExpression is CLS_Expression_SelfOpWithValue)
                {
                    content.Set(expGetValue.value_name, newVal);
                    return;
                }
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return;
            }

            base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:36,代码来源:ToCSLightColor.cs

示例8: MemberCall

        public override CLS_Content.Value MemberCall(CLS_Content content, object object_this, string function, BetterList<CLS_Content.Value> _params, bool isBaseCall = false)
        {
            CLS_Content.Value retVal = null;

            Vector3 newVal = (Vector3)object_this;
            if (function == "Equals")
            {
                retVal = new CLS_Content.Value();
                retVal.type = typeof(bool);
                retVal.value = newVal.Equals(_params[0].value);
            }
            else if (function == "Normalize")
            {
                newVal.Normalize();
                retVal = CLS_Content.Value.Void;
            }
            else if (function == "Scale")
            {
                newVal.Scale(((Vector3)_params[0].value));
                retVal = CLS_Content.Value.Void;
            }
            else if (function == "Set")
            {
                newVal.Set(Convert.ToSingle(_params[0].value), Convert.ToSingle(_params[1].value), Convert.ToSingle(_params[2].value));
                retVal = CLS_Content.Value.Void;
            }
            else if (function == "ToString")
            {
                if (_params.size == 0)
                {
                    retVal = new CLS_Content.Value();
                    retVal.type = typeof(string);
                    retVal.value = newVal.ToString();
                }
                else if (_params.size == 1)
                {
                    retVal = new CLS_Content.Value();
                    retVal.type = typeof(string);
                    retVal.value = newVal.ToString(((string)_params[0].value));
                }
            }
            else
                return base.MemberCall(content, object_this, function, _params, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return retVal;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return retVal;
            }

            return base.MemberCall(content, object_this, function, _params, isBaseCall);
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:61,代码来源:ToCSLightVector3.cs

示例9: ComputeValue

 public CLS_Content.Value ComputeValue(CLS_Content content)
 {
     content.Set(value_name, listParam[0].ComputeValue(content).value);
     return null;
 }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:5,代码来源:CLS_Expression_SetValue.cs

示例10: MemberValueSet

        public override void MemberValueSet(CLS_Content content, object object_this, string valuename, object value, bool isBaseCall = false)
        {
            Quaternion newVal = (Quaternion)object_this;
            if (valuename == "eulerAngles")
                newVal.eulerAngles = ((Vector3)value);
            else if (valuename == "w")
                newVal.w = Convert.ToSingle(value);
            else if (valuename == "x")
                newVal.x = Convert.ToSingle(value);
            else if (valuename == "y")
                newVal.y = Convert.ToSingle(value);
            else if (valuename == "z")
                newVal.z = Convert.ToSingle(value);
            else
                base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                if (content.CallExpression is CLS_Expression_SelfOpWithValue)
                {
                    content.Set(expGetValue.value_name, newVal);
                    return;
                }
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return;
            }

            base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:38,代码来源:ToCSLightQuaternion.cs


注:本文中的CSLE.CLS_Content.Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。