private void Start() { SmokeEnemy = new BTSequence(showNode, new BTCheckAttack(underAttack, isAtPlayer, agent), new BTFlyToCover(agent, cover), new BTWait(3f), new BTThrowSmoke(prefabBom, child, underAttack, hasAttacked) ); RotateAroundPlayer = new BTSequence(showNode, new BTTCheckAtPlayer(isAtPlayer), new BTFlyArroundPlayer(isAtPlayer, agent, child, player) ); GoToPlayer = new BTSequence(showNode, new BTCheckAttackDone(hasAttacked, agent), new BTMoveAlly(hasAttacked, isAtPlayer, child, agent, player) ); rootNode = new BTSelector(new List <BTBaseNode> { SmokeEnemy, GoToPlayer, RotateAroundPlayer }); rootNode.Run(); }
private void Start() { CheckSmoke = new BTSequence(showNode, new BTCheckSmoke(isInSmoke, agent) ); AttackTree = new BTSequence(showNode, new CheckPlayerRange(ClosestPlayer, hasWeapon, needsWeapon), new BTMove(agent, ClosestPlayer, showNode, weaponHolder, hasWeapon, cantAttack, lighting, WeaponCol) ); CheckWeapon = new BTSequence(showNode, new FindWeapon(needsWeapon), new BTGoForWeapon(agent, weapon, hasWeapon, needsWeapon, weaponHolder, weapon, lighting, CheckForWeaponCol) ); PatrollTree = new BTSequence(showNode, new BTPatrol(WayPoints, agent, lighting, PatrolCol) ); rootNode = new BTSelector(new List <BTBaseNode> { CheckSmoke, CheckWeapon, AttackTree, PatrollTree }); rootNode.Run(); }
private void FixedUpdate() { if (enemyTXT.text == "BTMove") { underAttack.active = true; } rootNode?.Run(); }
private void FixedUpdate() { checkSmoke(); FindVisibleTargets(); rootNode?.Run(); }