public override void Update(Apoc3D.GameTime time) { if (state == State.Opened) { StatisticRBall(false); } if (state == State.Opening) { animProgress += time.ElapsedGameTimeSeconds * 4; if (animProgress > 1) { animProgress = 1; ChangeState(State.Opened); } } else if (state == State.Closing) { animProgress -= time.ElapsedGameTimeSeconds * 4; if (animProgress < 0) { animProgress = 0; ChangeState(State.Close); } } }
public override void UpdateInteract(Apoc3D.GameTime time) { if (state == State.Opened) { selectedIndex = -1; for (int i = 0; i < 3; i++) { Vector2 size = transformedItemBR[i] - transformedItemTL[i]; Rectangle rect = new Rectangle((int)transformedItemTL[i].X, (int)transformedItemTL[i].Y, (int)size.X + 1, (int)size.Y + 1); if (Control.IsInBounds(MouseInput.X, MouseInput.Y, ref rect)) { selectedIndex = i; } } if (MouseInput.IsMouseUpLeft) { if (selectedIndex != -1) { if (resBallItemSelectedCount[selectedIndex] != 0) { selectedBallType = resBallsItemType[selectedIndex]; if (resBallItemSelectedCount[selectedIndex] != resBallItemCount[selectedIndex]) { selectedCount = resBallItemSelectedCount[selectedIndex]; isCountedThrow = true; } isCancelled = false; } } Close(); } } else if (state == State.Opening) { if (MouseInput.IsMouseDownRight) { isOpeningClicked = true; } if (MouseInput.IsMouseUpRight && isOpeningClicked) { isAllSelected = true; isCancelled = false; Close(); } } }