public override void SetContext(Agent agent, Behavior.Context behaviorContext) { DriveType driveType = null; Agent targetAgent = null; if (useTargetsDriveLevel) { if (behaviorContext.target == null || behaviorContext.target.GetComponent <Agent>() == null) { Debug.LogError("WaitForDriveBehavior using targets drive is missing target or target is not an Agent."); } else { targetAgent = behaviorContext.target.GetComponent <Agent>(); driveType = (DriveType)agent.decider.CurrentMapping.mappingType.inputConditions[0].levelType; } } else { targetAgent = agent; driveType = agent.decider.CurrentDriveType; } if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } context.attributeSelectors = behaviorContext.attributeSelectors; context.driveTypeToWaitFor = driveType; context.targetAgent = targetAgent; }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } context.attributeSelectors = behaviorContext.attributeSelectors; context.target = behaviorContext.target; }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } context.currentSpeed = behaviorContext.attributeSelectors[0].GetFloatValue(agent, agent.decider.CurrentMapping); context.target = behaviorContext.target; context.attributeSelectors = behaviorContext.attributeSelectors; }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } Selector attributeSelector = behaviorContext.attributeSelectors[0]; context.target = behaviorContext.target; context.attributeSelectors = behaviorContext.attributeSelectors; context.movementSpeedAT = (MinMaxFloatAT)behaviorContext.attributeSelectors[0].attributeType; context.currentSpeed = attributeSelector.GetFloatValue(agent, agent.decider.CurrentMapping); }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } Selector valueSelector = behaviorContext.attributeSelectors[0]; context.attributeSelectors = behaviorContext.attributeSelectors; context.currentSpeed = valueSelector.GetFloatValue(agent, agent.decider.CurrentMapping); context.lastVelocity = agent.movementType.VelocityMagnitude(agent); context.movementSpeedAT = (MinMaxFloatAT)valueSelector.attributeType; //context.energyAT = (MinMaxFloatAT)behaviorContext.attributeSelectors[1].attributeType; }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } Selector valueSelector = behaviorContext.attributeSelectors[0]; context.currentSpeed = valueSelector.GetFloatValue(agent, agent.decider.CurrentMapping); context.targetPosition = Vector3.positiveInfinity; context.attributeSelectors = behaviorContext.attributeSelectors; context.movementSpeedAT = (MinMaxFloatAT)valueSelector.attributeType; context.energyAT = (MinMaxFloatAT)behaviorContext.attributeSelectors[1].attributeType; }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { if (!agentsContexts.TryGetValue(agent, out Context context)) { context = new Context(); agentsContexts[agent] = context; } context.attributeSelectors = behaviorContext.attributeSelectors; context.agentEvent = (AgentEvent)behaviorContext.target; context.startTime = Time.time; context.startedMoving = false; context.targetPosition = Vector3.positiveInfinity; context.movementSpeed = context.attributeSelectors[0].GetFloatValue(agent, agent.decider.CurrentMapping); context.boolParamName = context.attributeSelectors[1].GetEnumValue <string>(agent, agent.decider.CurrentMapping); }
public override void SetContext(Agent agent, Behavior.Context behaviorContext) { }
public abstract void SetContext(Agent agent, Behavior.Context behaviorContext);