Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "enemy")
        {
            enemy_stats_base enemyStats = other.GetComponent <enemy_stats_base>();

            enemyStats.HealthTakeDamage(300.0f + (PlayerPrefs.GetInt("armorlevel") * 2.6f));
            other.GetComponent <enemy_knockback>().KnockbackThis(other.GetComponent <Transform>().position + gameObject.GetComponent <Transform>().forward * 55);
        }
    }
Esempio n. 2
0
 void Start()
 {
     _goalTransform    = GameObject.Find("player_01").transform;
     _selfObstacle     = gameObject.GetComponent <NavMeshObstacle>();
     _moveLogic        = GameObject.Find("GameManager").GetComponent <gm_Surround>();
     _subGoalTransform = _moveLogic.RequestAIDestination();
     _selfTransform    = gameObject.GetComponent <Transform>();
     _goalAnim         = GameObject.Find("player_01").GetComponent <Animator>();
     _selfAnim         = gameObject.GetComponent <Animator>();
     _parentTransform  = GameObject.FindGameObjectWithTag("epandprefab").transform;
     _gm                   = GameObject.Find("GameManager").GetComponent <gm_Primary>();
     _selfStatus           = gameObject.GetComponent <enemy_stats_base>();
     this.transform.parent = _parentTransform;
     _agent                = GetComponent <NavMeshAgent>();
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     _enemyStats = gameObject.GetComponent <UI_follow>()._parentObject.GetComponent <enemy_stats_base>();
     _rectData   = gameObject.transform.GetChild(1).GetChild(1).gameObject.GetComponent <RectTransform>();
 }