示例#1
0
    public void Init()
    {
        MANAGER.AddEnemyToList(this);
        AttackRange    = attackRange;
        Speed          = speed;
        IdleRange      = idleRange;
        AttackCD       = attackCD;
        AttackDuration = attackDuration;
        PassiveRange   = passiveRange;
        BaseHealth     = health;
        Level          = level;
        Team           = 1;

        BaseDamage     = baseDamage;
        DamagePerLevel = damagePerLevel;

        BaseArmor     = baseArmor;
        ArmorPerLevel = armorPerLevel;

        HealthPerLevel = healthPerLevel;

        UpdateStats();

        GameObject DamageHit = new GameObject("HitPoints");

        DamageHit.transform.SetParent(GameObject.Find("Canvas").transform);
        HealthTextEnnemy Script = DamageHit.AddComponent <HealthTextEnnemy>();

        Script.Init(transform);

        GetComponent <NavMeshAgent>().speed = GetSpeed;
    }
示例#2
0
    void Awake()
    {
        Team = 1;
        GameObject DamageHit = new GameObject("HitPoints");

        DamageHit.transform.SetParent(GameObject.Find("Canvas").transform);
        HealthTextEnnemy Script = DamageHit.AddComponent <HealthTextEnnemy>();

        Script.Init(transform);
    }