Exemple #1
0
    public void InitUnit(EnumInfo.TeamType _tType)
    {
        _tr       = transform;
        _unitData = DataManager.Instance.GetUnitDataWithUnitIdx(_unitIdx);
        _teamType = _tType;

        _stateMgr     = GetComponentInChildren <StateManager>();
        _animMgr      = GetComponentInChildren <AnimManager>();
        _behaviourMgr = GetComponentInChildren <BehaviourManager>();
        _moveMgr      = GetComponentInChildren <MoveManager>();
        _seeker       = GetComponentInChildren <Seeker>();

        _stateMgr.InitStateMgr(this);
        _animMgr.InitAnimMgr(this);
        _behaviourMgr.InitBehaviourMgr(this);
        _moveMgr.InitMoveMgr(this);


        if (_unitData.DamageType.Equals("Physic"))
        {
            _normalDamage.Type = EnumInfo.DamageType.Physic;
        }
        else
        {
            _normalDamage.Type = EnumInfo.DamageType.Magic;
        }
        _normalDamage.DamagePower  = _unitData.Damage;
        _normalDamage.ResourceUnit = this;

        if (_unitData.SkillDamageType.Equals("Physic"))
        {
            _skillDamage.Type = EnumInfo.DamageType.Physic;
        }
        else
        {
            _skillDamage.Type = EnumInfo.DamageType.Magic;
        }

        _skillDamage.DamagePower  = _unitData.SkillDamage;
        _skillDamage.ResourceUnit = this;
    }