public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); m_learnedBehaviorManager.m_baseMoveManager.m_NavMeshAgent.speed = _Brain.m_BaseMoveManager.m_RunSpeed; pursuitTatget = _Brain.m_SensorManager.m_SensorData.m_EnemyTarget.transform; }
public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); m_Animator.SetFloat("Speed", 0); //m_brain.m_BaseMoveManager.m_NavMeshAgent.speed = 0.01f; _Brain.m_BaseMoveManager.ChangeMoveTarget(_Brain.m_CurrentTransform); }
private bool FarAwayEnoughFormEvadeTarget(AICharacterBrain _brain) { if ((_brain.m_CurrentTransform.position - _brain.m_SensorManager.m_SensorData.m_EvadeTarget.transform.position).sqrMagnitude >= farAwayEnoughDistance * farAwayEnoughDistance) { return(true); } return(false); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { if (_Brain.m_SensorManager.m_SensorData.m_HaveEnemy) { return(true); } return(false); }
public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); _Brain.m_BaseMoveManager.ChangeMoveTarget(_Brain.m_CurrentTransform); m_Animator.SetFloat("Speed", 0); m_Animator.SetTrigger(m_Skill); SetTimeLag(); }
public void Initialize(AICharacterBrain _Brain) { brain = _Brain; aiSettings = _Brain.GetComponent <AISettings>(); if (aiSettings.m_SurfaceConscious) { m_AISurfaceConscious.Initialize(brain); } }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { if (_Brain.m_SensorManager.m_SensorData.m_NeedEvade) { //Debug.Log("Need Evade"); return(true); } return(false); }
public void InitializeDictionary(AICharacterBrain _Brain) { aiSetting = _Brain.GetComponent <AISettings>(); //将所有用户设置的关系加入dictionary //Debug.Log(aiSetting.m_PreSetAcquaintanceInfo.Count); for (int i = 0; i < aiSetting.m_PreSetAcquaintanceInfo.Count; i++) { m_Acquaintance.Add(aiSetting.m_PreSetAcquaintanceInfo[i].PreSetObject.name, aiSetting.m_PreSetAcquaintanceInfo[i].PreSetRelationship); } }
// Use this for initialization protected virtual void Start() { brain = GetComponent <AICharacterBrain>(); sensorData = brain.m_SensorManager.m_SensorData; neighbors = sensorData.m_Neighbors; peopleInMemory = brain.m_AIMemory.m_Acquaintance; if (stateText) { StartCoroutine(ShowState()); } }
/// <summary> /// 判断当前邻居是否是敌人,一次只有一个敌人 /// judge if current neighbors are enemy /// </summary> /// <param name="_Brain"></param> public void JudgeIfNeighborIsEnemy(AICharacterBrain _Brain) { brain = _Brain; for (int i = 0; i < brain.m_SensorManager.m_SensorData.m_Neighbors.Count; i++) { if (brain.m_AIMemory.m_Acquaintance[brain.m_SensorManager.m_SensorData.m_Neighbors[i].name] == AISettings.RelationShip.Hate) { brain.m_SensorManager.m_SensorData.m_HaveEnemy = true; brain.m_SensorManager.m_SensorData.m_EnemyTarget = brain.m_SensorManager.m_SensorData.m_Neighbors[i]; return; } } }
public void JudgeIfNeighborIsWhoIFear(AICharacterBrain _Brain) { brain = _Brain; for (int i = 0; i < brain.m_SensorManager.m_SensorData.m_Neighbors.Count; i++) { if (brain.m_AIMemory.m_Acquaintance[brain.m_SensorManager.m_SensorData.m_Neighbors[i].name] == AISettings.RelationShip.Fear) { brain.m_SensorManager.m_SensorData.m_NeedEvade = true; brain.m_SensorManager.m_SensorData.m_EvadeTarget = brain.m_SensorManager.m_SensorData.m_Neighbors[i]; return; } } }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { animator = _Brain.GetComponent <Animator>(); animStateInfomation = animator.GetCurrentAnimatorStateInfo(0); for (int i = 0; i < matchAnimatorName.Length; i++) { if (animStateInfomation.IsName(matchAnimatorName[i])) { return(true); } } return(false); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { if (_Brain.m_SensorManager.m_SensorData.m_HaveEnemy) { float distanceBetweenEnemyAndAI = (_Brain.m_CurrentTransform.transform.position - _Brain.m_SensorManager.m_SensorData.m_EnemyTarget.transform.position).sqrMagnitude; if (distanceBetweenEnemyAndAI <= arrivedDistance * arrivedDistance) { // Debug.Log("Arrived Target" + _Brain.m_BaseMoveManager.m_NavMeshAgent.remainingDistance); return(true); } } return(false); }
//private LearnedBehavior currentLearnedBehavior;//当前决定所对应的学习性行为 /// <summary> /// 初始化LearnedBehaviorManager /// </summary> /// <param name="_Brain">传入的AIbrain</param> public void Initialize(AICharacterBrain _Brain) { brain = _Brain; aiSettings = _Brain.GetComponent <AISettings>(); // Debug.Log(aiSettings.m_PatrolPlace[0].position); baseMoveManager = _Brain.m_BaseMoveManager; for (int i = 0; i < aiSettings.m_PatrolPlace.Count; i++) { if (aiSettings.m_PatrolPlace[i] != null) { m_PatrolTargets.Add(aiSettings.m_PatrolPlace[i].position); } } InitializeDecision(); }
/// <summary> /// 初始化patrol /// </summary> /// <param name="_learnedBehaviorManager"></param> public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); //Debug.Log("in here"); //Debug.Log(_learnedBehaviorManager.m_PatrolTargets.Count); //Debug.Log(patrolTarget.Length); m_learnedBehaviorManager.m_baseMoveManager.m_NavMeshAgent.speed = _Brain.m_BaseMoveManager.m_WalkSpeed; timeLag = timeLagRecorder; for (int i = 0; i < m_learnedBehaviorManager.m_PatrolTargets.Count; i++) { //Debug.Log(m_learnedBehaviorManager.m_PatrolTargets[i]); patrolQueue.Enqueue(m_learnedBehaviorManager.m_PatrolTargets[i]); } //Debug.Log(patrolQueue.Count); m_Animator.SetFloat("Speed", 1); }
// Use this for initialization void Start() { brain = GetComponent <AICharacterBrain>(); aiSettings = GetComponent <AISettings>(); originalPlace = new Vector3(m_CurrentTransform.position.x, m_CurrentTransform.position.y, m_CurrentTransform.position.z); if (aiSettings.m_PreSetAcquaintanceInfo.Count == 0) { aiSettings.m_PreSetAcquaintanceInfo.Add(aiSettings.CreatePreSetAcquaintanceInfo(GameObject.FindGameObjectWithTag("Player"), AISettings.RelationShip.Hate)); //Debug.Log(aiSettings.m_PreSetAcquaintanceInfo[0].PreSetObject + " " + aiSettings.m_PreSetAcquaintanceInfo[0].PreSetRelationship); } //anim = GetComponent<Animator>(); delayTimer = aiSettings.m_DelayTimer; recordDelayTimer = aiSettings.m_DelayTimer; InitializeProperty(); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { animator = _Brain.GetComponent <Animator>(); animStateInfomation = animator.GetCurrentAnimatorStateInfo(0); if ((_Brain.m_SensorManager.M_GetCurrentEnemyTarget().transform.position - _Brain.m_CurrentTransform.position).sqrMagnitude > farAwayDistance * farAwayDistance) { bool _flagOfMove = true; for (int i = 0; i < matchAnimatorName.Length; i++) { if ((animStateInfomation.IsName(matchAnimatorName[i]))) { _flagOfMove = false; break; } } if (_flagOfMove) { return(true); } } return(false); }
public override void InitializeSensor(AICharacterBrain _Brain) { brain = _Brain; aiSettings = _Brain.GetComponent <AISettings>(); }
/// <summary> /// 用于传入参数 /// </summary> /// <param name="_Brain">接收外部传入的aicharacterBrain </param> public void Initialize(AICharacterBrain _Brain) { brain = _Brain; navMeshAgent = brain.GetComponent <NavMeshAgent>(); }
private NextDecision[] nextDecision;//将会有些什么决定 /// <summary> /// 初始化决定以及相对应的学习性行为 /// </summary> /// <param name="_Brain"></param> public void Initialize(AICharacterBrain _Brain) { learnedBehavior = Instantiate(learnedBehavior); learnedBehavior.Initialize(_Brain); }
public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); timeLag = 2f; m_Animator.SetFloat("Speed", 2); }
public virtual bool MatchedChangeCondition(AICharacterBrain _Brain) { return(false); }
public virtual void Initialize(AICharacterBrain _Brain) { m_brain = _Brain; m_Animator = _Brain.GetComponent <Animator>(); m_learnedBehaviorManager = _Brain.m_LearnedBehaviorManager; }
private Vector3 evadePosition = new Vector3(); //逃离到的地点 public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); evadeTarget = _Brain.m_SensorManager.M_GetCurrentEvadeTarget().transform; }
public virtual void Initialize(AICharacterBrain _Brain) { m_brain = _Brain; }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { return(false); }
public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { return(FarAwayEnoughFormEvadeTarget(_Brain)); }
public virtual void InitializeSensor(AICharacterBrain _Brain) { }