public override int GetPressingFrame(ButtonType buttonType) { if (IsNormalButton(buttonType) && inputManager.IsDisabled((MarkType)buttonType)) { return(0); } return(inputInfo.GetPressingFrame(buttonType)); }
public override int GetPressingFrame(ButtonType buttonType) { if (buttonType > ButtonType.L) { return(baseInputInfo.GetPressingFrame(buttonType)); } return(pressCount[(int)buttonType]); }
public override void Update(InputInfoBase inputInfo, MouseInfo mouseInfo) { base.Update(inputInfo, mouseInfo); if (inputInfo.GetPressingFrame(ButtonType.Up) > 0) { if (contentSprite.Alpha < 1) { contentSprite.Alpha += 0.01f; } } else if (inputInfo.GetPressingFrame(ButtonType.Down) > 0) { if (contentSprite.Alpha > 0) { contentSprite.Alpha -= 0.01f; } } }
/// <summary> /// 押されているフレーム数を取得します。 /// </summary> /// <param name="buttonType"></param> /// <returns></returns> public override int GetPressingFrame(ButtonType buttonType) { return(baseInputInfo.GetPressingFrame(buttonType)); }
public override void Update(InputInfoBase inputInfo, MouseInfo mouseInfo) { ProcessNetworkData(); if (fadeOut) { if (black.Alpha >= 1) { black.Alpha = 1; switch (fadeOutAction) { case FadeOutAction.WaitFinish: waitFinishCount++; if (waitFinishCount % 10 == 9) { client.Write(MessagePackSerializer.Serialize(new SendResultNetworkData { Result = new Result { Score = mainGameComponent.Score, CoolCount = mainGameComponent.CoolCount, GoodCount = mainGameComponent.GoodCount, SafeCount = mainGameComponent.SafeCount, SadCount = mainGameComponent.SadCount, WorstCount = mainGameComponent.WorstCount, MaxCombo = mainGameComponent.MaxCombo } })); } break; case FadeOutAction.SendNetworkData: client.Write(MessagePackSerializer.Serialize(new SendResultNetworkData { Result = new Result { Score = mainGameComponent.Score, CoolCount = mainGameComponent.CoolCount, GoodCount = mainGameComponent.GoodCount, SafeCount = mainGameComponent.SafeCount, SadCount = mainGameComponent.SadCount, WorstCount = mainGameComponent.WorstCount, MaxCombo = mainGameComponent.MaxCombo } })); fadeOutAction = FadeOutAction.WaitFinish; break; } } else { black.Alpha += 0.05f; if (black.Alpha >= 1) { black.Alpha = 1; } } } userScoreListComponent.Update(); if (ready) { if (!paused) { int lastWorstCount = mainGameComponent.GameResultManager.WorstCount; mainGameComponent.Update(inputInfo, mouseInfo); if (gameRule.ItemAvailable && gameRule.ItemSupplyType == ItemSupplyType.ComboWorstCount) { int currentWorstCount = mainGameComponent.GameResultManager.WorstCount; int count = currentWorstCount / gameRule.ItemSupplyWorstCount - lastWorstCount / gameRule.ItemSupplyWorstCount; for (int i = 0; i < count; i++) { itemOverrayComponent.AddItem(lastMarkPos); } } } } if (paused) { if (pauseMenu != null) { pauseMenu.Update(inputInfo); } } else { if (lastStartPressCount >= 60) { paused |= pauseMenu != null; } if (inputInfo.IsReleased(ButtonType.Start) && lastStartPressCount < 60) { if (itemManagerComponent.CanUse) { UseItem(itemManagerComponent.Use()); } } } foreach (ItemUseEventArgs args in itemManagerComponent.EnumerateItem()) { if (ItemUseManager.Manager.IsAutoUse(args.ItemType)) { UseItem(args.ItemType); args.Use = true; } } itemManagerComponent.Update(); itemOverrayComponent.Update(); config.Update(); filterSprite.Update(); base.Update(); CheckChange(); lastStartPressCount = inputInfo.GetPressingFrame(ButtonType.Start); if (expansionClient != null) { var currentTime = mainGameComponent.MoviePosition; expansionClient.Send(new UpdateInfo { Score = mainGameComponent.Score, PlayerId = selfUser.ID, CurrentTime = currentTime, Life = mainGameComponent.GameResultManager.CurrentLife, CoolCount = mainGameComponent.CoolCount, GoodCount = mainGameComponent.GoodCount, SafeCount = mainGameComponent.SafeCount, SadCount = mainGameComponent.SadCount, WorstCount = mainGameComponent.WorstCount, MaxCombo = mainGameComponent.MaxCombo }); foreach (var user in userPlayStateList) { expansionClient.Send(new UpdateInfo { Score = user.Score, PlayerId = user.User.ID, CurrentTime = currentTime, Life = user.Life }); } } }