本文整理汇总了C#中behaviac类的典型用法代码示例。如果您正苦于以下问题:C# behaviac类的具体用法?C# behaviac怎么用?C# behaviac使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
behaviac类属于命名空间,在下文中一共展示了behaviac类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: EvaluteAssignment
public static bool EvaluteAssignment(Agent pAgent, Property opl, Property opr, behaviac.CMethodBase opr_m)
{
bool bValid = false;
if (opl != null)
{
if (opr_m != null)
{
object returnValue = opr_m.Invoke(pAgent);
Agent pParentOpl = opl.GetParentAgent(pAgent);
opl.SetValue(pParentOpl, returnValue);
bValid = true;
}
else if (opr != null)
{
Agent pParentL = opl.GetParentAgent(pAgent);
Agent pParentR = opr.GetParentAgent(pAgent);
opl.SetFrom(pParentR, opr, pParentL);
bValid = true;
}
}
return bValid;
}
开发者ID:XyzalZhang,项目名称:behaviac,代码行数:28,代码来源:Assignment.cs
示例2: update_impl
protected override EBTStatus update_impl(behaviac.Agent pAgent, behaviac.EBTStatus childStatus)
{
Debug.Check(behaviac.Utils.MakeVariableId("par_float_type_0") == 569873069u);
float method_p0 = pAgent.GetVariable<float>(569873069u);
((AgentNodeTest)pAgent).setTestVar_2(method_p0);
return EBTStatus.BT_SUCCESS;
}
开发者ID:Just4F,项目名称:behaviac,代码行数:7,代码来源:generated_behaviors.cs
示例3: GetProperty
public static object GetProperty(behaviac.Agent agent, string property)
{
Type type = agent.GetType();
string propertyName = type.FullName + property;
if (_fields.ContainsKey(propertyName))
{
return _fields[propertyName].GetValue(agent);
}
if (_properties.ContainsKey(propertyName))
{
return _properties[propertyName].GetValue(agent, null);
}
while (type != typeof(object))
{
FieldInfo field = type.GetField(property, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
if (field != null)
{
_fields[propertyName] = field;
return field.GetValue(agent);
}
PropertyInfo prop = type.GetProperty(property, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
if (prop != null)
{
_properties[propertyName] = prop;
return prop.GetValue(agent, null);
}
type = type.BaseType;
}
Debug.Check(false, "No property can be found!");
return null;
}
开发者ID:wuzhen,项目名称:behaviac,代码行数:35,代码来源:generated_behaviors.cs
示例4: update_impl
protected override EBTStatus update_impl(behaviac.Agent pAgent, behaviac.EBTStatus childStatus)
{
EBTStatus result = EBTStatus.BT_SUCCESS;
int opr = 2;
Debug.Check(behaviac.Utils.MakeVariableId("parT_SpawnCountPerWave") == 193379536u);
pAgent.SetVariable<int>("parT_SpawnCountPerWave", 193379536u, opr);
return result;
}
开发者ID:Just4F,项目名称:behaviac,代码行数:8,代码来源:generated_behaviors.cs
示例5: GetWeight
protected virtual int GetWeight(behaviac.Agent pAgent)
{
if (this.m_weight != null)
{
Debug.Check(this.m_weight is CInstanceMember<int>);
return ((CInstanceMember<int>)this.m_weight).GetValue(pAgent);
}
return 0;
}
开发者ID:Just4F,项目名称:behaviac,代码行数:10,代码来源:Decoratorweight.cs
示例6: GetWeight
protected virtual int GetWeight(behaviac.Agent pAgent)
{
if (this.m_weight_var != null)
{
Debug.Check(this.m_weight_var != null);
int count = (int)this.m_weight_var.GetValue(pAgent);
return count;
}
return 0;
}
开发者ID:Oswin2014,项目名称:Behavior_Tree-Practice-in-Unity,代码行数:12,代码来源:Decoratorweight.cs
示例7: ExportMethod
private static void ExportMethod(Dictionary<string, Type> types, XmlWriter xmlWriter, MethodInfo m, behaviac.MethodMetaInfoAttribute methodDesc, string eventName, bool onlyExportPublicMembers)
{
string methodName = !string.IsNullOrEmpty(eventName) ? eventName : m.Name;
// if (methodName == "Func_SByteListIR")
// {
// Debug.Check(true);
// }
if (!m.IsPublic)
{
if (!Config.IsSuppressingNonPublicWarning)
{
string warningInfo = string.Format("Export non-public method : {0}.{1}()", m.DeclaringType.Name, methodName);
Debug.LogWarning(warningInfo);
}
if (onlyExportPublicMembers)
{
return;
}
}
Type returnType = m.ReturnType;
if (methodDesc.IsNamedEvent && returnType != typeof(bool))
{
string clsName = (m.DeclaringType.DeclaringType != null) ? m.DeclaringType.DeclaringType.Name : m.DeclaringType.Name;
behaviac.Debug.LogWarning(string.Format("The return type of {0}.{1}() is not bool type", clsName, methodName));
returnType = typeof(bool);
}
string returnTypeStr = GetFullTypeName(returnType);
Type parentClassType = m.DeclaringType;
if (methodDesc.IsNamedEvent)
{
parentClassType = m.DeclaringType.DeclaringType;
}
string parentClassTypeFullName = GetFullTypeName(parentClassType);
if (types == null)
{
xmlWriter.WriteStartElement("Method");
xmlWriter.WriteAttributeString("Name", methodName);
xmlWriter.WriteAttributeString("DisplayName", methodDesc.DisplayName);
xmlWriter.WriteAttributeString("Desc", methodDesc.Description);
xmlWriter.WriteAttributeString("ReturnType", returnTypeStr);
xmlWriter.WriteAttributeString("Class", parentClassTypeFullName);
if (m.IsStatic)
{
xmlWriter.WriteAttributeString("Static", "true");
}
if (m.IsPublic)
{
xmlWriter.WriteAttributeString("Public", "true");
}
if (methodDesc.IsNamedEvent)
{
xmlWriter.WriteAttributeString("Flag", "namedevent");
}
}
//TODO:IsActionMethodOnly
ParameterInfo[] parameters = m.GetParameters();
foreach (ParameterInfo para in parameters)
{
Attribute[] paramAttributes = (Attribute[])para.GetCustomAttributes(typeof(behaviac.ParamMetaInfoAttribute), false);
Type paramType = para.ParameterType;
if (para.ParameterType.IsByRef)
{
paramType = para.ParameterType.GetElementType();
}
string paramNativeType = GetFullTypeName(paramType);
string paramDisplayName = para.Name;
string paramDescription = paramDisplayName;
string defaultValue = "";
float rangeMin = float.MinValue;
float rangeMax = float.MaxValue;
if (paramAttributes.Length > 0)
{
behaviac.ParamMetaInfoAttribute paramDescAttr = ((behaviac.ParamMetaInfoAttribute)paramAttributes[0]);
paramDisplayName = paramDescAttr.DisplayName;
paramDescription = paramDescAttr.Description;
defaultValue = paramDescAttr.DefaultValue;
rangeMin = paramDescAttr.RangeMin;
rangeMax = paramDescAttr.RangeMax;
}
if (para.ParameterType.IsByRef)
{
paramNativeType += "&";
}
//.........这里部分代码省略.........
开发者ID:nusus,项目名称:behaviac,代码行数:101,代码来源:Workspace.cs
示例8: predicateFirePoint
public Vector3 predicateFirePoint(behaviac.Agent target)
{
return Vector3.zero;
}
开发者ID:nusus,项目名称:behaviac,代码行数:4,代码来源:Player.cs
注:本文中的behaviac类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论