示例#1
1
        public bool QueryPropObject(string strPropName, ref ObjectID oResult)
        {
            if (strPropName == null)
            {
                return(false);
            }

            try
            {
                if (!mPropSet.ContainsKey(strPropName))
                {
                    return(false);
                }

                GameProperty prop = mPropSet[strPropName];
                if (null == prop)
                {
                    return(false);
                }

                VarList.VarData propValue = prop.getPropValue();
                if (propValue == null)
                {
                    return(false);
                }

                if (propValue.nType != VarType.Object)
                {
                    return(false);
                }

                oResult = (propValue.Data as ObjectID).Clone();
                return(true);
            }
            catch (Exception ex)
            {
                //Log.TraceError("Error, exception " + ex.ToString());
                return(false);
            }
        }
示例#2
0
        public bool QueryPropObject(string strPropName, ref ObjectID oResult)
        {
            if (strPropName == null)
            {
                return(false);
            }

            try
            {
                if (!mPropSet.ContainsKey(strPropName))
                {
                    return(false);
                }

                GameProperty prop = mPropSet[strPropName];

                Var propValue = prop.getPropValue();

                if (propValue.Type != VarType.Object)
                {
                    return(false);
                }

                oResult = propValue.GetObject();
                return(true);
            }
            catch (Exception ex)
            {
                LogSystem.LogError("Error, exception ", ex.ToString());
                return(false);
            }
        }