void Update() { if (mIsDragging) { Vector2 aPosition = uThumb.GetManager().ScreenToGui(new Vector2(Input.mousePosition.x, Input.mousePosition.y)); aPosition = new Vector2(aPosition.x, 0 - aPosition.y); // TODO: these numbers are hardcoded - copied from the unity gui - figure out how to get this programatically Vector2 relativePosition = new Vector2(aPosition.x - 179, aPosition.y + 521); if (relativePosition.x < 0) { relativePosition = new Vector2(0, relativePosition.y); } if (relativePosition.x > 420) { relativePosition = new Vector2(420, relativePosition.y); } mRecordingPlayer.Jump(relativePosition.x / (420 / 30)); if (!Input.GetMouseButton(0)) { mIsDragging = false; mRecordingPlayer.Continue(); } } if (mRecordingPlayer != null) { uThumb.Position = new Vector2((float)mRecordingPlayer.uTime * (420 / 30), 0); } }
void ShowChannel(int pChannelNumber) { mNetworkManager.myPlayer.uLastWatchedChannel = pChannelNumber; uStationInformationIsVisible = true; mWatchingPlayer = pChannelNumber; mInformationCountdown = Game.CHANNEL_INFORMATION_COUNTDOWN; if (!uIsPreparing) { mRecordingPlayer.Play(mNetworkManager.playersOrderedByStation[mWatchingPlayer], mScreen); mRecordingPlayer.Jump(mTime); mNetworkManager.myPlayer.StartWatchingStation(mNetworkManager.playersOrderedByStation[mWatchingPlayer].uID.ToString(), mTime.ToString()); } }