Пример #1
0
        ///Resolve the final Variable reference.
        private Variable ResolveReference(IBlackboard targetBlackboard, bool useID)
        {
            var targetName = this.name;

            if (targetName != null && targetName.Contains("/"))
            {
                var split = targetName.Split('/');
                targetBlackboard = GlobalBlackboard.Find(split[0]);
                targetName       = split[1];
            }

            Variable result = null;

            if (targetBlackboard == null)
            {
                return(null);
            }
            if (useID && targetVariableID != null)
            {
                result = targetBlackboard.GetVariableByID(targetVariableID);
            }
            if (result == null && !string.IsNullOrEmpty(targetName))
            {
                result = targetBlackboard.GetVariable(targetName, varType);
            }
            return(result);
        }
Пример #2
0
        private Variable ResolveReference(IBlackboard targetBlackboard, bool useID)
        {
            var targetName = this.name;
            if (targetName != null && targetName.Contains("/")){
                var split = targetName.Split('/');
                targetBlackboard = GlobalBlackboard.Find(split[0]);
                targetName = split[1];
            }

            Variable result = null;
            if (targetBlackboard == null){ return null; }
            if (useID && targetVariableID != null){ result = targetBlackboard.GetVariableByID(targetVariableID); }
            if (result == null && !string.IsNullOrEmpty(targetName)){ result = targetBlackboard.GetVariable(targetName, varType); }
            return result;
        }