public virtual object Math2Value(CLS_Content env, char code, object left, CLS_Content.Value right, out CLType returntype)
{
returntype = type;
System.Reflection.MethodInfo call = null;
//var m = ((Type)type).GetMembers();
if (code == '+')
{
if ((Type)right.type == typeof(string))
{
returntype = typeof(string);
return left.ToString() + right.value as string;
}
call = _type.GetMethod("op_Addition", new Type[] { this.type, right.type });
}
else if (code == '-')//base = {CLScriptExt.Vector3 op_Subtraction(CLScriptExt.Vector3, CLScriptExt.Vector3)}
call = _type.GetMethod("op_Subtraction", new Type[] { this.type, right.type });
else if (code == '*')//[2] = {CLScriptExt.Vector3 op_Multiply(CLScriptExt.Vector3, CLScriptExt.Vector3)}
call = _type.GetMethod("op_Multiply", new Type[] { this.type, right.type });
else if (code == '/')//[3] = {CLScriptExt.Vector3 op_Division(CLScriptExt.Vector3, CLScriptExt.Vector3)}
call = _type.GetMethod("op_Division", new Type[] { this.type, right.type });
else if (code == '%')//[4] = {CLScriptExt.Vector3 op_Modulus(CLScriptExt.Vector3, CLScriptExt.Vector3)}
call = _type.GetMethod("op_Modulus", new Type[] { this.type, right.type });
var obj = call.Invoke(null, new object[] { left, right.value });
//function.StaticCall(env,"op_Addtion",new List<ICL>{})
return obj;
}