public CQ_Value ComputeValue(CQ_Content content) { #if CQUARK_DEBUG content.InStack(this); #endif CQ_Value parent = _expressions[0].ComputeValue(content); if (parent == null) { throw new Exception("调用空对象的方法:" + _expressions[0].ToString() + ":" + ToString()); } CQ_Value value = null; //这几行是为了快速获取Unity的静态变量,而不需要反射 if (!Wrap.MemberValueGet(parent.type.type, parent.value, membername, out value)) { IClass iclass = CQuark.AppDomain.GetType(parent.type)._class; CQClassInstance s = parent.value as CQClassInstance; if (s != null) { iclass = s.type; } value = iclass.MemberValueGet(content, parent.value, membername); } #if CQUARK_DEBUG content.OutStack(this); #endif return(value); //做数学计算 //从上下文取值 //_value = null; //return null; }
public CQ_Value ComputeValue(CQ_Content content) { #if CQUARK_DEBUG content.InStack(this); #endif CQ_Value parent = _expressions[0].ComputeValue(content); if (parent == CQ_Value.Null) { throw new Exception("调用空对象的方法:" + _expressions[0].ToString() + ":" + ToString()); } IType type = CQuark.AppDomain.GetITypeByCQValue(parent); CQ_Value getvalue = CQ_Value.Null; object obj = parent.GetObject(); //这几行是为了快速获取Unity的静态变量,而不需要反射 if (!Wrap.MemberValueGet(parent.m_type, obj, membername, out getvalue)) { getvalue = type._class.MemberValueGet(content, obj, membername); } CQ_Value vright = CQ_Value.One; if (_expressions.Count > 1) { vright = _expressions[1].ComputeValue(content); } IType mtype = CQuark.AppDomain.GetITypeByCQValue(getvalue); CQ_Value vout = mtype.Math2Value(mathop, getvalue, vright); //这几行是为了快速获取Unity的静态变量,而不需要反射 if (!Wrap.MemberValueSet(parent.m_type, obj, membername, vout)) { type._class.MemberValueSet(content, obj, membername, vout); } #if CQUARK_DEBUG content.OutStack(this); #endif return(vout); }