示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     motor   = GetComponent <TankMotor>();
     data    = GetComponent <TankData>();
     shooter = GetComponent <TankShooter>();
     CanSee  = GetComponent <AISenses>();
     CanHear = GetComponent <AISenses>();
 }
    // Start is called before the first frame update
    void Start()
    {
        senses = GetComponent <AISenses>();

        tf = GetComponent <Transform>();

        homePoint = tf.position;
    }
示例#3
0
    // Start is called before the first frame update
    public virtual void Start()
    {
        senses = GetComponent <AISenses>();

        tf = GetComponent <Transform>();

        noisemaker = GetComponent <Noisemaker>();

        homePoint = tf.position;
    }
示例#4
0
    // Use this for initialization
    void Start()
    {
        // Store my senses component
        senses = GetComponent <AISenses>();

        tf = GetComponent <Transform>();

        // Save home point
        homePoint = tf.position;
    }
示例#5
0
    // Start is called before the first frame update
    public virtual void Start()
    {
        // Store my senses component
        senses = GetComponent <AISenses>();

        tf = GetComponent <Transform>();

        // Load noisemaker
        noisemaker = GetComponent <Noisemaker>();

        // Save home point
        homePoint = tf.position;
    }
示例#6
0
    public AIContext(AIAgent agent, AISenses senses, Transform head, Animator animator, NavMeshAgent navAgent)
    {
        Agent              = agent;
        Senses             = senses;
        Head               = head;
        Animator           = animator;
        NavAgent           = navAgent;
        NavAgent.isStopped = true;
        Mobile             = agent.GetComponent <Mobile>();
        Mobile.Init(this);
        CanSense = true;

        base.Init();
    }
示例#7
0
    public bool canAttack  = false; //A bool to allow the enemy to attack or not attack

    // Start is called before the first frame update
    public virtual void Start()
    {
        bulletPrefab.tag = "Bullet";

        // Store my senses component
        senses = GetComponent <AISenses>();

        tf = GetComponent <Transform>();

        rb = GetComponent <Rigidbody2D>();

        controller = GetComponent <PlayerController>();

        // Load noisemaker
        noisemaker = GetComponent <Noisemaker>();
    }
示例#8
0
 public void Setup(HumanSheet humanSheetIn, bool isZombie, GameObject squadDeployment = null)
 {
     this.humanSheet = humanSheetIn;
     this.isZombie   = isZombie;
     animator        = transform.parent.GetComponent <Animator> ();
     stateMachine    = transform.parent.GetComponent <AnimationStateMachine> ();
     stateMachine.Setup(this);
     animationEvents = transform.parent.GetComponent <AnimationEvents> ();
     animationEvents.Setup(this);
     agent      = transform.parent.GetComponent <NavMeshAgent> ();
     navigation = GetComponent <AINavigation> ();
     navigation.Setup(showAgent);
     senses = GetComponent <AISenses> ();
     senses.Setup();
     vision = transform.parent.GetComponentInChildren <AIVision> ();
     vision.Setup(this, showVisionTargets, showNearVision, showMidVision, showFarVision);
     combat = GetComponent <AICombat> ();
     combat.Setup(this);
     if (isZombie)
     {
         //Debug.Log ("zombie perception : " + humanSheet.stats.perception);
         motor         = new ZombieMotor(this, transform.parent.GetComponent <Animator> ());
         behaviourTree = new BTZombie();
     }
     else
     {
         //Debug.Log ("swat perception : " + humanSheet.stats.perception);
         motor         = new HumanMotor(this, transform.parent.GetComponent <Animator> ());
         behaviourTree = new BTSwat();
     }
     behaviourTree.squadDeployment = squadDeployment;
     behaviourTree.Setup(humanSheet, this);
     //motor.UpdateAvatarMask ();
     agent.updatePosition = false;
     //agent.updateRotation = false;
     behaviourTree.StartTree();
 }
 // Use this for initialization
 void Start()
 {
     pawnTransform = pawn.transform;
     senses        = GameObject.Find("Eyes").GetComponent <AISenses>();
 }