예제 #1
0
 protected override ModelConditionFlag[] GetModelConditionFlags(int weaponIndex) =>
 new[]
 {
     ModelConditionFlagUtility.GetFiringFlag(weaponIndex),
     ModelConditionFlagUtility.GetFiringOrPreAttackFlag(weaponIndex),
     ModelConditionFlagUtility.GetFiringOrReloadingFlag(weaponIndex)
 };
예제 #2
0
        internal Weapon(
            GameObject gameObject,
            WeaponTemplate weaponTemplate,
            int weaponIndex,
            WeaponSlot slot,
            AudioSystem audioSystem,
            AssetLoadContext assetLoadContext)
        {
            _gameObject     = gameObject;
            _weaponTemplate = weaponTemplate;
            _weaponIndex    = weaponIndex;

            Slot = slot;

            FillClip();

            var nuggets = new List <WeaponEffectNugget>();

            foreach (var nuggetData in weaponTemplate.Nuggets)
            {
                var nugget = nuggetData.CreateNugget(this);
                if (nugget != null) // TODO: This should never be null.
                {
                    nuggets.Add(nugget);
                }
            }
            Nuggets = nuggets.ToArray();

            _stateMachine = new WeaponStateMachine(
                new WeaponStateContext(
                    gameObject,
                    this,
                    weaponTemplate,
                    weaponIndex,
                    audioSystem,
                    assetLoadContext));

            _usingFlag = ModelConditionFlagUtility.GetUsingWeaponFlag(weaponIndex);
        }
예제 #3
0
파일: Weapon.cs 프로젝트: wu162/OpenSAGE
        internal Weapon(
            GameObject gameObject,
            WeaponTemplate weaponTemplate,
            int weaponIndex,
            WeaponSlot slot,
            GameContext gameContext)
        {
            ParentGameObject = gameObject;
            Template         = weaponTemplate;
            WeaponIndex      = weaponIndex;

            Slot = slot;

            FillClip();

            _stateMachine = new WeaponStateMachine(
                new WeaponStateContext(
                    gameObject,
                    this,
                    gameContext));

            _usingFlag = ModelConditionFlagUtility.GetUsingWeaponFlag(weaponIndex);
        }
예제 #4
0
 protected override ModelConditionFlag[] GetModelConditionFlags(int weaponIndex) =>
 new[]
 {
     ModelConditionFlagUtility.GetBetweenFiringShotsFlag(weaponIndex)
 };