本文整理汇总了C#中MyShootActionEnum类的典型用法代码示例。如果您正苦于以下问题:C# MyShootActionEnum类的具体用法?C# MyShootActionEnum怎么用?C# MyShootActionEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyShootActionEnum类属于命名空间,在下文中一共展示了MyShootActionEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
{
if (MySession.Static.CreativeMode)
return;
base.Shoot(action, direction, gunAction);
if (action == MyShootActionEnum.PrimaryAction && !m_firstShot)
{
if ((MySandboxGame.TotalGamePlayTimeInMilliseconds - m_lastKeyPress) >= 500)
{
//MyRenderProxy.DebugDrawText2D(new Vector2(50.0f, 50.0f), "Holding cube placer", Color.Red, 1.0f);
// CH:TODO: This should probably be done only locally
var block = GetTargetBlock();
if (block != null)
{
MyDefinitionId welderDefinition = new MyDefinitionId(typeof(MyObjectBuilder_Welder));
if (Owner.CanSwitchToWeapon(welderDefinition))
{
Owner.SetupAutoswitch(new MyDefinitionId(typeof(MyObjectBuilder_Welder)), new MyDefinitionId(typeof(MyObjectBuilder_CubePlacer)));
}
}
}
}
}
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:25,代码来源:MyCubePlacer.cs
示例2: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction)
{
if (action != MyShootActionEnum.PrimaryAction)
return;
m_barrel.StartShooting();
}
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:7,代码来源:MyLargeMissileTurret.cs
示例3: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
{
if (action != MyShootActionEnum.PrimaryAction)
return;
m_gunBase.Shoot(Parent.Physics.LinearVelocity);
}
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:7,代码来源:MyLargeGatlingTurret.cs
示例4: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction)
{
if (action != MyShootActionEnum.PrimaryAction)
return;
m_gunBase.Shoot(Vector3.Zero);
}
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:7,代码来源:MyLargeGatlingTurret.cs
示例5: CanShoot
public override bool CanShoot(MyShootActionEnum action, long shooter, out MyGunStatusEnum status)
{
bool retval = base.CanShoot(action, shooter, out status);
// No need for cooldown for the first shot
if (status == MyGunStatusEnum.Cooldown && action == MyShootActionEnum.PrimaryAction && m_firstShot == true)
{
status = MyGunStatusEnum.OK;
retval = true;
}
return retval;
}
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:13,代码来源:MyBlockPlacerBase.cs
示例6: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction, Vector3D? overrideWeaponPos, string gunAction)
{
//small reloadable launcher have cooldown
if ((BurstFireRate == m_numRocketsShot) && (MySandboxGame.TotalGamePlayTimeInMilliseconds < m_nextShootTime))
{
return;
}
if (BurstFireRate == m_numRocketsShot)
{
m_numRocketsShot = 0;
}
m_numRocketsShot++;
base.Shoot(action, direction, overrideWeaponPos, gunAction);
}
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:15,代码来源:MySmallMissileLauncherReload.cs
示例7: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
{
if (MySession.Static.CreativeMode)
return;
m_closeAfterBuild = false;
base.Shoot(action, direction, gunAction);
ShakeAmount = 0.0f;
if (action == MyShootActionEnum.PrimaryAction && m_firstShot)
{
m_firstShot = false;
m_lastKeyPress = MySandboxGame.TotalGamePlayTimeInMilliseconds;
var definition = MyCubeBuilder.Static.HudBlockDefinition;
if (definition == null)
{
return;
}
if (!Owner.ControllerInfo.IsLocallyControlled())
{
var val = Owner.IsUsing as MyCockpit;
if (val != null && !val.ControllerInfo.IsLocallyControlled())
return;
}
// Must have first component to start building
if (MyCubeBuilder.Static.CanStartConstruction(Owner))
{
bool placingGrid = MyCubeBuilder.Static.ShipCreationClipboard.IsActive;
m_closeAfterBuild = MyCubeBuilder.Static.AddConstruction(Owner) && placingGrid;
return;
}
else
{
if (!MySession.Static.Battle && MySession.Static.IsAdminModeEnabled==false)
OnMissingComponents(definition);
}
}
}
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:43,代码来源:MyBlockPlacerBase.cs
示例8: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction)
{
if (MySession.Static.CreativeMode)
return;
m_closeAfterBuild = false;
base.Shoot(action, direction);
ShakeAmount = 0.0f;
if (action == MyShootActionEnum.PrimaryAction && m_firstShot)
{
m_firstShot = false;
m_lastKeyPress = MySandboxGame.TotalGamePlayTimeInMilliseconds;
var definition = MyCubeBuilder.Static.HudBlockDefinition;
if (definition == null)
{
return;
}
MyCharacter character = CharacterInventory.Owner as MyCharacter;
Debug.Assert(character != null, "Character inventory was not owned by a character");
if (character.ControllerInfo.IsRemotelyControlled())
return;
// Must have first component to start building
if (MyCubeBuilder.Static.CanStartConstruction(character))
{
bool placingGrid = MyCubeBuilder.Static.ShipCreationClipboard.IsActive;
m_closeAfterBuild = MyCubeBuilder.Static.AddConstruction(character) && placingGrid;
return;
}
else
{
if (!MySession.Static.Battle)
OnMissingComponents(definition);
}
}
}
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:42,代码来源:MyBlockPlacerBase.cs
示例9: Shoot
override public void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
{
//small reloadable launcher have cooldown
if ((NUM_ROCKETS_TO_COOLDOWN == m_numRocketsShot) && (COOLDOWN_TIME_MILISECONDS > MySandboxGame.TotalGamePlayTimeInMilliseconds - m_lastTimeShoot))
{
return;
}
if (NUM_ROCKETS_TO_COOLDOWN == m_numRocketsShot)
{
m_numRocketsShot = 0;
}
m_numRocketsShot++;
base.Shoot(action, direction, gunAction);
if (m_numRocketsShot == NUM_ROCKETS_TO_COOLDOWN)
{
MyHud.Notifications.Add(MISSILE_RELOAD_NOTIFICATION);
}
}
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:20,代码来源:MySmallMissileLauncherReload.cs
示例10: ShootBeginCallback
void ShootBeginCallback(Vector3 direction, MyShootActionEnum action)
{
bool wouldCallStartTwice = Sync.IsServer && MyEventContext.Current.IsLocallyInvoked;
if (!wouldCallStartTwice)
{
StartShooting(direction, action);
}
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:8,代码来源:MyCharacter.cs
示例11: BeginShootSync
public void BeginShootSync(Vector3 direction, MyShootActionEnum action = MyShootActionEnum.PrimaryAction)
{
StartShooting(direction, action);
MyMultiplayer.RaiseEvent(this, x => x.ShootBeginCallback, direction, action);
if (MyFakes.SIMULATE_QUICK_TRIGGER)
EndShootInternal(action);
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:9,代码来源:MyCharacter.cs
示例12: StartShooting
private void StartShooting(Vector3 direction, MyShootActionEnum action)
{
ShootDirection = direction;
m_isShooting[(int)action] = true;
OnBeginShoot(action);
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:6,代码来源:MyCharacter.cs
示例13: IsShooting
public bool IsShooting(MyShootActionEnum action)
{
return m_isShooting[(int)action];
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:4,代码来源:MyCharacter.cs
示例14: OnEndShoot
public void OnEndShoot(MyShootActionEnum action)
{
if (m_currentMovementState != MyCharacterMovementEnum.Died && m_currentWeapon != null)
{
m_currentWeapon.EndShoot(action);
// CH:TODO: End on which shoot? Primary or secondary?
if (m_endShootAutoswitch != null)
{
SwitchToWeapon(m_endShootAutoswitch);
m_endShootAutoswitch = null;
}
}
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:14,代码来源:MyCharacter.cs
示例15: BeginShoot
public void BeginShoot(MyShootActionEnum action)
{
if (!SyncObject.IsWaitingForWeaponSwitch)
{
MyGunStatusEnum status = MyGunStatusEnum.OK;
IMyGunObject<MyDeviceBase> gun = null;
bool canShoot = GridSelectionSystem.CanShoot(action, out status, out gun);
if (status != MyGunStatusEnum.OK)
{
ShowShootNotification(status, gun);
}
SyncObject.BeginShoot((Vector3)PositionComp.WorldMatrix.Forward, action);
}
}
开发者ID:notten,项目名称:SpaceEngineers,代码行数:16,代码来源:MyShipController.cs
示例16: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction)
{
base.Shoot(action, direction);
if (action == MyShootActionEnum.PrimaryAction && IsPreheated && Sync.IsServer && m_activated)
{
Grind();
}
return;
}
开发者ID:martejj,项目名称:SpaceEngineers,代码行数:10,代码来源:MyAngleGrinder.cs
示例17: EndShootInternal
private void EndShootInternal(MyShootActionEnum action = MyShootActionEnum.PrimaryAction)
{
MyMultiplayer.RaiseEvent(this, x => x.ShootEndCallback, action);
StopShooting(action);
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:5,代码来源:MyCharacter.cs
示例18: StopShooting
private void StopShooting(MyShootActionEnum action)
{
m_isShooting[(int)action] = false;
OnEndShoot(action);
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:5,代码来源:MyCharacter.cs
示例19: OnBeginShoot
public void OnBeginShoot(MyShootActionEnum action)
{
if (ControllerInfo == null) return;
if (m_currentWeapon == null) return;
MyGunStatusEnum status = MyGunStatusEnum.OK;
m_currentWeapon.CanShoot(action, ControllerInfo.ControllingIdentityId, out status);
if (status == MyGunStatusEnum.OutOfAmmo)
{
// mw:TODO should auto change be implemented or not (uncomment code below)
//if (m_currentWeapon.GunBase.SwitchAmmoMagazineToFirstAvailable())
// status = MyGunStatusEnum.OK;
}
if (status != MyGunStatusEnum.OK && status != MyGunStatusEnum.Cooldown)
{
ShootBeginFailed(action, status);
}
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:20,代码来源:MyCharacter.cs
示例20: BeginShoot
public void BeginShoot(MyShootActionEnum action)
{
if (m_currentWeapon == null || m_currentMovementState == MyCharacterMovementEnum.Died) return;
if (!m_currentWeapon.EnabledInWorldRules)
{
MyHud.Notifications.Add(MyNotificationSingletons.WeaponDisabledInWorldSettings);
return;
}
BeginShootSync(m_currentWeapon.DirectionToTarget(m_aimedPoint), action);
}
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:12,代码来源:MyCharacter.cs
注:本文中的MyShootActionEnum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论