本文整理汇总了C#中CSLE.CLS_Content.Value类的典型用法代码示例。如果您正苦于以下问题:C# CLS_Content.Value类的具体用法?C# CLS_Content.Value怎么用?C# CLS_Content.Value使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CLS_Content.Value类属于CSLE命名空间,在下文中一共展示了CLS_Content.Value类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: New
public override CLS_Content.Value New(CLS_Content content, BetterList<CLS_Content.Value> _params)
{
CLS_Content.Value val = new CLS_Content.Value();
val.type = typeof(SphereCollider);
val.value = new SphereCollider();
return val;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:7,代码来源:ToCSLightSphereCollider.cs
示例2: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
var parent = listParam[0].ComputeValue(content);
if (parent == null)
{
throw new Exception("调用空对象的方法:" + listParam[0].ToString() + ":" + ToString());
}
var type = content.environment.GetType(parent.type);
//string membername=null;
var getvalue = type.function.MemberValueGet(content, parent.value, membername);
CLS_Content.Value vright = CLS_Content.Value.One;
if (listParam.Count > 1)
{
vright = listParam[1].ComputeValue(content);
}
CLS_Content.Value vout =new CLS_Content.Value();
var mtype = content.environment.GetType(getvalue.type);
vout.value = mtype.Math2Value(content, mathop, getvalue.value, vright, out vout.type);
type.function.MemberValueSet(content, parent.value, membername, vout.value);
//CLS_Content.Value v = new CLS_Content.Value();
content.OutStack(this);
return vout;
//做数学计算
//从上下文取值
//_value = null;
//return null;
}
开发者ID:lightszero,项目名称:cslightcore,代码行数:34,代码来源:CLS_Expression_MemberMath.cs
示例3: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
List<object> list = new List<object>();
int count = listParam[0] == null ? (listParam.Count - 1) : (int)listParam[0].ComputeValue(content).value;
if (count == 0)
throw new Exception("不能创建0长度数组");
CLS_Content.Value vcount = new CLS_Content.Value();
vcount.type = typeof(int);
vcount.value = count;
for (int i = 1; i < listParam.Count; i++)
{
//if (listParam[i] != null)
{
list.Add(listParam[i].ComputeValue(content).value);
}
}
List<CLS_Content.Value> p = new List<CLS_Content.Value>();
p.Add(vcount);
var outvalue = type.function.New(content, p);
for (int i = 0; i < list.Count; i++)
{
type.function.IndexSet(content, outvalue.value, i, list[i]);
}
content.OutStack(this);
return outvalue;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:28,代码来源:CLS_Expression_FunctionNewArray.cs
示例4: New
public override CLS_Content.Value New(CLS_Content content, BetterList<CLS_Content.Value> _params)
{
CLS_Content.Value val = new CLS_Content.Value();
val.type = typeof(Time);
val.value = new Time();
return val;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:7,代码来源:ToCSLightTime.cs
示例5: Call
public CLS_Content.Value Call(CLS_Content content, IList<CLS_Content.Value> param)
{
CLS_Content.Value v = new CLS_Content.Value();
List<object> objs = new List<object>();
//var _params = dele.Method.GetParameters();
for (int i = 0; i < this.defvalues.Count; i++)
{
if (i >= param.Count)
{
objs.Add(defvalues[i]);
}
else
{
if (this.paramtype[i] == (Type)param[i].type)
{
objs.Add(param[i].value);
}
else
{
object conv = content.environment.GetType(param[i].type).ConvertTo(content, param[i].value, paramtype[i]);
objs.Add(conv);
}
}
}
v.type = this.returntype;
v.value = dele.DynamicInvoke(objs.ToArray());
return v;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:28,代码来源:RegHelper_Function.cs
示例6: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
int arraySize = listParam[0] == null ? (listParam.Count - 1) : (int)listParam[0].ComputeValue(content).value;
if (arraySize == 0)
throw new Exception("不能创建0长度数组");
int initValCount = listParam.Count - 1;
object[] initVals = new object[initValCount];
for (int i = 1; i < listParam.Count; i++)
{
initVals[i - 1] = listParam[i].ComputeValue(content).value;
}
CLS_Content.Value vcount = new CLS_Content.Value();
vcount.type = typeof(int);
vcount.value = arraySize;
BetterList<CLS_Content.Value> _params = CLS_Content.NewParamList();
_params.Add(vcount);
CLS_Content.Value newVal = type.function.New(content, _params);
for (int i = 0; i < initValCount; i++)
{
type.function.IndexSet(content, newVal.value, i, initVals[i]);
}
CLS_Content.PoolParamList(_params);
content.OutStack(this);
return newVal;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:31,代码来源:CLS_Expression_FunctionNewArray.cs
示例7: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value rv = new CLS_Content.Value();
{
var v = listParam[0].ComputeValue(content);
{
rv.type = v.type;
rv.value = v.value;
}
Exception err = v.value as Exception;
if (err != null)
{
throw err;
}
else
{
throw new Exception(v.ToString());
}
}
content.OutStack(this);
return rv;
//for 逻辑
//做数学计算
//从上下文取值
//_value = null;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:31,代码来源:CLS_Expression_Throw.cs
示例8: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value result = new CLS_Content.Value();
result.type = typeof(bool);
bool bleft = (bool)listParam[0].ComputeValue(content).value;
if (mathop == '&')
{
if (!bleft)
{
result.value = false;
}
else
{
result.value = bleft && (bool)listParam[1].ComputeValue(content).value;
}
}
else if (mathop == '|')
{
if (bleft)
{
result.value = true;
}
else
{
result.value = bleft || (bool)listParam[1].ComputeValue(content).value;
}
}
content.OutStack(this);
return result;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:34,代码来源:CLS_Expression_Math2ValueAndOR.cs
示例9: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
CLS_Content.Value value = new CLS_Content.Value();
value.type = typeof(DeleLambda);
value.value = new DeleLambda(content, this.listParam[0].listParam, this.listParam[1]);
return value;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:7,代码来源:CLS_Expression_Lambda.cs
示例10: New
public override CLS_Content.Value New(CLS_Content content, BetterList<CLS_Content.Value> _params)
{
CLS_Content.Value val = new CLS_Content.Value();
val.type = typeof(UnityEngine.Random);
val.value = new UnityEngine.Random();
return val;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:7,代码来源:ToCSLightRandom.cs
示例11: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value rv = new CLS_Content.Value();
rv.breakBlock = 10;
if (listParam.Count > 0&&listParam[0]!=null)
{
var v = listParam[0].ComputeValue(content);
{
rv.type = v.type;
rv.value = v.value;
}
}
else
{
rv.type = typeof(void);
}
content.OutStack(this);
return rv;
//for 逻辑
//做数学计算
//从上下文取值
//_value = null;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:25,代码来源:CLS_Expression_LoopReturn.cs
示例12: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value rv = new CLS_Content.Value();
rv.breakBlock = 2;
//跳出逻辑
content.OutStack(this);
return rv;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:9,代码来源:CLS_Expression_LoopBreak.cs
示例13: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value left = listParam[0].ComputeValue(content);
CLS_Content.Value right = listParam[1].ComputeValue(content);
CLS_Content.Value result = new CLS_Content.Value();
result.value = content.environment.GetType(left.type).Math2Value(content, mathop, left.value, right, out result.type);
content.OutStack(this);
return result;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:10,代码来源:CLS_Expression_Math2Value.cs
示例14: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value right = listParam[0].ComputeValue(content);
ICLS_Type type = content.environment.GetType(right.type);
CLS_Content.Value value = new CLS_Content.Value();
value.type = targettype;
value.value = type.ConvertTo(content, right.value, targettype);
content.OutStack(this);
return value;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:11,代码来源:CLS_Expression_TypeConvert.cs
示例15: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
//List<CLS_Content.Value> list = new List<CLS_Content.Value>();
CLS_Content.Value value = new CLS_Content.Value();
value.type = typeof(DeleLambda);
value.value = new DeleLambda(content,(this.listParam[0] as CLS_Expression_Block).listParam,this.listParam[1]);
//创建一个匿名方法
content.OutStack(this);
return value;
}
开发者ID:lightszero,项目名称:cslightcore,代码行数:12,代码来源:CLS_Expression_Lambda.cs
示例16: MemberCall
public override CLS_Content.Value MemberCall(CLS_Content content, object object_this, string function, BetterList<CLS_Content.Value> _params, bool isBaseCall = false)
{
if (function == "ClosestPointOnBounds")
{
CLS_Content.Value val = new CLS_Content.Value();
val.type = typeof(Vector3);
val.value = ((Collider)object_this).ClosestPointOnBounds(((Vector3)_params[0].value));
return val;
}
return base.MemberCall(content, object_this, function, _params, isBaseCall);
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:12,代码来源:ToCSLightCollider.cs
示例17: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value result = new CLS_Content.Value();
//if(mathop=="<"||mathop=="<="||mathop==">"||mathop==">="||mathop=="=="||mathop=="!=")
{
result.type = typeof(bool);
var left = listParam[0].ComputeValue(content);
var right = listParam[1].ComputeValue(content);
if(left.type==null||right.type==null)
{
if (mathop == logictoken.equal)
{
result.value = left.value == right.value;
}
if(mathop== logictoken.not_equal)
{
result.value = left.value != right.value;
}
}
else if ((Type)left.type == typeof(bool) && (Type)right.type == typeof(bool))
{
if (mathop == logictoken.equal)
{
result.value = (bool)left.value == (bool)right.value;
//return result;
}
else if (mathop == logictoken.not_equal)
{
result.value = (bool)left.value != (bool)right.value;
//return result;
}
else
{
throw new Exception("bool 不支持此运算符");
}
}
else
{
result.value = content.environment.GetType(left.type).MathLogic(content, mathop, left.value, right);
}
}
content.OutStack(this);
return result;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:50,代码来源:CLS_Expression_Math2ValueLogic.cs
示例18: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value r = listParam[0].ComputeValue(content);
CLS_Content.Value r2 = new CLS_Content.Value();
r2.type = r.type;
r2.breakBlock = r.breakBlock;
r2.value = !(bool)r.value;
content.OutStack(this);
return r2;
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:15,代码来源:CLS_Expression_NegativeLogic.cs
示例19: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
content.InStack(this);
CLS_Content.Value oriVal = listParam[0].ComputeValue(content);
CLS_Content.Value retVal = new CLS_Content.Value();
ICLS_Type type = content.environment.GetType(oriVal.type);
retVal.value = type.Math2Value(content, '~', oriVal.value, CLS_Content.Value.One, out retVal.type);
content.OutStack(this);
return retVal;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:15,代码来源:CLS_Expression_NegativeBit.cs
示例20: ComputeValue
public CLS_Content.Value ComputeValue(CLS_Content content)
{
CLS_Content.Value srcVal = listParam[0].ComputeValue(content);
// 不能直接修改srcVal
CLS_Content.Value val = new CLS_Content.Value();
val.type = srcVal.type;
val.value = srcVal.value;
val.breakBlock = srcVal.breakBlock;
val.breakBlock += 10;
#if UNITY_EDITOR
if (val.value is System.Collections.IEnumerator)
throw new Exception("Dont support yield return IEnumerator, please use StartCoroutine(IEnumerator) instead: " + content.DumpStack());
#endif
return val;
}
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:15,代码来源:CLS_Expression_Yield.cs
注:本文中的CSLE.CLS_Content.Value类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论