Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AIBrain{
- //how fast should this character move
- public var moveSpeed:float;
- //how close should this enemy get to to target
- public var minDistance:float;
- //unity's navagation system
- public var Legs:NavMeshAgent;
- //how close can a person get to this npc before it reacts
- public var EnemyDetectionRange:float;
- //how fast should this npc turn
- public var rotationSpeed:float;
- }
- //this controlls all the combat varibles and functions for thhe npc
- public class AIAttack{
- //the person the npc should attack
- public var target:Transform;
- //this tells the enemy to go into attack mode
- public var Provoked:boolean;
- //how close we can get before we can attack
- public var attackRange:float;
- //sometimes the npc has muliple target it needs to attack
- public var targets:GameObject[];
- //the countdown timer to attack
- public var attackTimer:float;
- //the lenght of time between attacks
- public var cooldown:float;
- //let the npc know when it can shoot a bullet so it doesnt shoot them back to back
- public var CanAttack:boolean;
- //the function to countdown to attack
- function CountdownTimer(){
- if(attackTimer > 0){
- attackTimer -= Time.deltaTime;
- }
- if(attackTimer < 0){
- attackTimer =0;
- }
- if(attackTimer ==0) {
- CanAttack=true;
- }
- }
- }
- //this class controls all the rpg stats of the the npc
- public class AIStats{
- //how much damage should the npc do
- public var damage:float;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement