本文整理汇总了C#中MyShootActionEnum类的典型用法代码示例。如果您正苦于以下问题:C# MyShootActionEnum类的具体用法?C# MyShootActionEnum怎么用?C# MyShootActionEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyShootActionEnum类属于命名空间,在下文中一共展示了MyShootActionEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)));
}
}
}
}
}
示例2: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction)
{
if (action != MyShootActionEnum.PrimaryAction)
return;
m_barrel.StartShooting();
}
示例3: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
{
if (action != MyShootActionEnum.PrimaryAction)
return;
m_gunBase.Shoot(Parent.Physics.LinearVelocity);
}
示例4: Shoot
public override void Shoot(MyShootActionEnum action, Vector3 direction)
{
if (action != MyShootActionEnum.PrimaryAction)
return;
m_gunBase.Shoot(Vector3.Zero);
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例10: ShootBeginCallback
void ShootBeginCallback(Vector3 direction, MyShootActionEnum action)
{
bool wouldCallStartTwice = Sync.IsServer && MyEventContext.Current.IsLocallyInvoked;
if (!wouldCallStartTwice)
{
StartShooting(direction, action);
}
}
示例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);
}
示例12: StartShooting
private void StartShooting(Vector3 direction, MyShootActionEnum action)
{
ShootDirection = direction;
m_isShooting[(int)action] = true;
OnBeginShoot(action);
}
示例13: IsShooting
public bool IsShooting(MyShootActionEnum action)
{
return m_isShooting[(int)action];
}
示例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;
}
}
}
示例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);
}
}