// Button activated private void OnMouseUpAsButton() { this.GetComponent <SpriteRenderer>().sprite = hoverSprite; // Start the trade process. if (this.tradeState == TradeState.NotTrading) { timerScript.GoToDraftState(DraftState.DraftPaused); this.SwitchToTradeState(TradeState.ChooseFirstPlayer); DOTween.To(() => this.blackScreenAlpha, x => this.blackScreenAlpha = x, 0.75f, timerScript.animationTime); } // End or cancel the trade process. else { this.SwitchToTradeState(TradeState.NotTrading); DOTween.To(() => this.blackScreenAlpha, x => this.blackScreenAlpha = x, 0.0f, timerScript.animationTime); } }
// Button activated private void OnMouseUpAsButton() { // Pausing the draft if (currentSprite == pauseSprite) { timerScript.GoToDraftState(DraftState.DraftPaused); currentSprite = playSprite; currentHoverSprite = playHoverSprite; } else { // Continue the draft timerScript.SwapDraftState(); currentSprite = pauseSprite; currentHoverSprite = pauseHoverSprite; } // Ensure we get our new hover sprite in place this.GetComponent <SpriteRenderer>().sprite = currentHoverSprite; }