Exemplo n.º 1
0
    // Use this for initialization
    public void Awake()
    {
        currentSkillFlags = new Dictionary <string, float>();
        unitRenderer      = GetComponentsInChildren <Renderer>();
        if (gameObject.tag.Contains(vars.enemy_tag))
        {
            //setRenderer(false);
        }

        uiManager        = GameObject.Find(vars.ui_manager_name).GetComponent <ui_manager>();
        unitNavMeshAgent = GetComponent <NavMeshAgent>();
        unitAnimator     = GetComponent <Animator>();
        if (unitGroup != null)
        {
            setAttributesFromGroup();
        }

        isUnitDisabled = false;

        unitCombatTarget = null;
        if (unitRange.myCollider != null)
        {
            unitRange.myCollider.radius = unitCurrentVisionrange;
        }

        unitTransform = this.transform;
        unitRadius    = unitNavMeshAgent.radius + 1;
    }
Exemplo n.º 2
0
  // Start is called before the first frame update
  void Start()
  {
      transform.position = new Vector3(0, -2.5f, 0);
      _spawnManager      = GameObject.Find("Spawn Enemy").GetComponent <SpawnManager>();
      UIManager          = GameObject.Find("Canvas").GetComponent <ui_manager>();
      _gameManager       = GameObject.Find("Game Manager").GetComponent <Game_Manager>();
      _audioSource       = GetComponent <AudioSource>();

      if (_spawnManager == null)
      {
          Debug.LogError("The _spawnManager is null");
      }

      if (UIManager == null)
      {
          Debug.LogError("UI Manager is NULL");
      }
  }
Exemplo n.º 3
0
    // is tripleshot enabled

    // Start is called before the first frame update
    void Start()
    {
        //take the current position=new position(0,0,0)
        transform.position = new Vector3(2, -1, 0);
        _SpawnManager      = GameObject.Find("SpawnManager").GetComponent <SpawnManager>();
        if (_SpawnManager == null)
        {
            Debug.Log("did not grab properly");
        }
        _ui_Manager  = GameObject.Find("Canvas").GetComponent <ui_manager>();
        _audioSource = GetComponent <AudioSource>();
        if (_ui_Manager == null)
        {
            Debug.LogError("the ui manager is null");
        }
        if (_audioSource == null)
        {
            Debug.LogError("the audio source is null");
        }
        else
        {
            _audioSource.clip = _laserSound;
        }
    }
Exemplo n.º 4
0
    // Use this for initialization
    public void Awake()
    {
        currentSkillFlags = new Dictionary<string, float>();
        unitRenderer = GetComponentsInChildren<Renderer>();
        if(gameObject.tag.Contains(vars.enemy_tag)) {
            //setRenderer(false);
        }

        uiManager = GameObject.Find(vars.ui_manager_name).GetComponent<ui_manager>();
        unitNavMeshAgent = GetComponent<NavMeshAgent>();
        unitAnimator = GetComponent<Animator>();
        if(unitGroup != null) {
            setAttributesFromGroup();
        }

        isUnitDisabled = false;

        unitCombatTarget = null;
        if(unitRange.myCollider != null) {
            unitRange.myCollider.radius = unitCurrentVisionrange;
        }

        unitTransform = this.transform;
        unitRadius = unitNavMeshAgent.radius + 1;
    }
Exemplo n.º 5
0
 private void Awake()
 {
     instance = this;
 }
    public void Start()
    {
        selectTier(1);
        if(!baseManager) {
            baseManager = GameObject.Find (vars.base_name).GetComponent<base_manager>();
        }

        if(!uiManager) {
            uiManager = GameObject.Find (vars.ui_manager_name).GetComponent<ui_manager>();
        }
    }