Exemple #1
0
 void Awake()
 {
     floorMask = LayerMask.GetMask("Floor");
     playerRB  = GetComponent <Rigidbody>();
     enemyTM   = FindObjectOfType <EnemyTargetManager>();
     health.SetValues();
     Stamina.SetValues();
 }
 void Awake()
 {
     health.SetValues();
     player        = FindObjectOfType <PlayerController>();
     turret        = FindObjectOfType <BaseTurret>();
     targetManager = FindObjectOfType <EnemyTargetManager>();
     agent         = GetComponent <NavMeshAgent>();
     myPos         = transform;
     agent.speed   = moveSpeed;
 }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         //DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
    void Awake()
    {
        shootableMask = LayerMask.GetMask("Shootable");
        floorMask     = LayerMask.GetMask("Floor");
        dayRef        = FindObjectOfType <DayNightCycle>();
        turretLR      = GetComponentInChildren <LineRenderer>();
        enemyTM       = FindObjectOfType <EnemyTargetManager>();
        turretLight   = GetComponentInChildren <Light>();
        Light turretSpotLight = gameObject.GetComponent <Light>();

        health.SetValues();
    }
Exemple #5
0
 void Awake()
 {
     health.SetValues();
     player              = FindObjectOfType <PlayerController>();
     turret              = FindObjectOfType <BaseTurret>();
     targetManager       = FindObjectOfType <EnemyTargetManager>();
     dayRef              = FindObjectOfType <DayNightCycle>();
     agent               = GetComponent <NavMeshAgent>();
     attackRadius        = GetComponent <CapsuleCollider>();
     agent.speed         = moveSpeed;
     attackRadius.radius = attackRange;
     attackRadius.height = attackRange;
 }
    void Awake()
    {
        health.SetValues();
        player              = FindObjectOfType <PlayerController>();
        fire                = FindObjectOfType <FireManager>();
        turret              = FindObjectOfType <BaseTurret>();
        wall                = FindObjectOfType <Durability>();
        targetManager       = FindObjectOfType <EnemyTargetManager>();
        dayRef              = FindObjectOfType <DayNightCycle>();
        agent               = GetComponent <NavMeshAgent>();
        attackRadius        = GetComponent <CapsuleCollider>();
        agent.speed         = moveSpeed;
        attackRadius.radius = attackRange;
        attackRadius.height = attackRange;

        foreach (GameObject waypoint in GameObject.FindGameObjectsWithTag("Waypoint"))
        {
            wayPoints.Add(waypoint);
        }

        chosenWayPoint = Random.Range(0, wayPoints.Count);

        targetWayPoint = wayPoints[chosenWayPoint].transform.position;
    }
 void Awake()
 {
     enemyTM = FindObjectOfType <EnemyTargetManager>();
     enemyTM.AddTarget(transform);
     health.SetValues();
 }
 // Use this for initialization
 void Start()
 {
     enemyTM = FindObjectOfType <EnemyTargetManager>();
     enemyTM.AddTarget(transform);
 }
Exemple #9
0
 private void Awake()
 {
     enemyTM = FindObjectOfType <EnemyTargetManager>();
     inv     = FindObjectOfType <Inventory>();
     health.SetValues();
 }