예제 #1
0
    // Start is called before the first frame update

    private void Awake()
    {
        Battlefield battlefieldComponent = battlefield.GetComponent <Battlefield>();

        battlefieldComponent.AddUnit(this);

        List <WeaponModel> weapons = new List <WeaponModel>();

        foreach (WeaponType weaponType in weaponTypes)
        {
            weapons.Add(WeaponModel.create(weaponType));
        }

        _groudmap  = battlefieldComponent.Groundmap;
        _model     = UnitModel.create(startingLevel, type, weapons, randomLevelUp, initialOrientation);
        _transform = gameObject.transform;
        _scheduler = GetComponent <UnitAnimatorManager>();
    }