public void Start() { ActionInstant seq = new ActionRepeat(new ActionSequence(new ActionInstant[] { new ActionFadeIn(2), new ActionParallel(new ActionInstant[] { new ActionMoveBy(new Vector3(10, 10, 0), 1), new ActionRotateBy(new Vector3(90, 90, 0), 1), new ActionTintBy(new Vector4(-50, 50, -150), 1) }), new ActionScaleBy(new Vector3(2, 2, 1), 1), new ActionScaleBy(new Vector3(0.5F, 0.5F, 2), 1), new ActionDelay(1), new ActionBlink(5, 0.1F, 0.4F), new ActionDelay(1), new ActionDelay(1), new ActionJumpBy(new Vector3(-10, 0, 0), 1, 4, 1), new ActionJumpTo(new Vector3(10, 10, 10), 1, 3, 1), new ActionRotateBy(new Vector3(90, 0, 0), 1), new ActionJumpBy(new Vector3(-10, 0, 0), 1, 2, 1), new ActionDelay(0.5F), new ActionBezierRel(new Vector2(5, 0), new Vector2(5, -10), new Vector2(0, -10), 2), new ActionScaleTo(new Vector3(2, 2, 2), 1), new ActionRotateTo(new Vector3(0, 0, 0), 1), new ActionFadeOut(2), new ActionSetTint(new Vector4(67, 105, 181)), new ActionSendMessage("MessageHello"), new ActionSendMessage("MessageHelloTo", "world"), }), 5); this.AttachAction(seq); AddMethodToCache(MessageHello); AddMethodToCache <string>(MessageHelloTo); }
/// <summary> /// Envia a requisição ao serviço externo. /// </summary> /// <param name="relativeUrl">URL relativa.</param> /// <param name="parameters">Parâmetros GET.</param> /// <returns></returns> public TResp GetData(string relativeUrl, string parameters) { var url = string.Format(CultureInfo.InvariantCulture, "{0}/{1}", Url, relativeUrl); ////Controle de tentativa caso ocorra uma instabilidade na rede. var requestReturn = ActionRepeat.TryRun(() => APIUtil.SendGetRequest(url, Token, parameters), timeListInMilliseconds); ////Converte o resultado da requisicao para objeto. return(APIUtil.ConvertHttpResponseMessageToObject <TResp>(requestReturn)); }
// For the button to call. public void Use() { AudioManager.PlayButtonClickSound(); int numCards = 0; switch (sDrawTier) { case CardTier.Bronze: numCards = 1; break; case CardTier.Silver: numCards = 3; break; case CardTier.Gold: numCards = 5; break; } if (RepeatPanelControls.NumRepeatsLeft > 0) { numCards *= RepeatPanelControls.NumRepeatsLeft; // Cap at 5, no point going more than that, just wastes processing power. if (numCards > 5) { numCards = 5; } // Clear the repeats. RepeatPanelControls.ClearRepeats(); } // Organise the cards. DeckManager.Instance.ReorganiseCards(); // Draw cards. DelayAction draw = new DelayAction(0.3f); draw.OnActionFinish += () => { DeckManager.Instance.DrawCard(); }; ActionRepeat repeatedDraw = new ActionRepeat(draw, numCards); ActionHandler.RunAction(repeatedDraw); // Dismiss panel. ControlAreaManager.SetCardPanelVisibility(CardType.DrawCard, false); }
public void AddCoins(int _numCoins) { // Play coin get animation. MoveByAction moveUp = new MoveByAction(mCoinTransform, Graph.Linear, Vector3.up * 1.4f, kfCoinAnimDuration); moveUp.OnActionStart += () => { mCoinTransform.position = transform.position; mCoinSpriteRen.enabled = true; mPlayerData.Coins++; AudioManager.PlayCoinGetSound(); PlayerInfoManager.Instance.UpdateCoins(mPlayerData.Coins); }; ActionRepeat repeatedCoinGet = new ActionRepeat(moveUp, _numCoins); DelayAction hideCoin = new DelayAction(kfCoinAnimDuration * _numCoins + 0.5f); hideCoin.OnActionFinish += () => { mCoinSpriteRen.enabled = false; }; ActionHandler.RunAction(repeatedCoinGet, hideCoin); }