private void AwaitCardClick(AsyncStateInfo state) { state.IsComplete = false; if (runtimeData.AllCardsSet && Input.GetMouseButtonDown(0)) { RaycastHit hit; Ray ray = camera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { var card = hit.transform.GetComponent <Card>(); if (card != null && !runtimeData.UpFacedCards.Contains(card)) { card.FaceUp(); runtimeData.UpFacedCards.Add(card); state.IsComplete = true; } } } }
private void AwaitGameComplite(AsyncStateInfo state) { // todo: game complete condition; state.IsComplete = false; }
private void AwaitAllCardsSet(AsyncStateInfo state) { state.IsComplete = runtimeData.AllCardsSet; }
private void IsOutroCutSceneFinished(AsyncStateInfo state) { state.IsComplete = cameraAnimator.GetCurrentAnimatorStateInfo(0).IsName("Camera_End") && cameraAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1.0f; }
private void AwaitFindAllPairs(AsyncStateInfo state) { state.IsComplete = runtimeData.CardsSet.Count != 0; }
public AsyncStateOperationArgs(Func <TArgs, AsyncOperation> awaitFunc, TArgs args) { _awaitFunc = awaitFunc; _args = args; _info = new AsyncStateInfo(); }
private void AwaitFunc(AsyncStateInfo state) { state.IsComplete = memoryCardDeal.IsFinishGameRound; }
public AsyncStateOperation(Func <AsyncOperation> awaitFunc) { _awaitFunc = awaitFunc; _info = new AsyncStateInfo(); }
public AsyncStateAwait(Action <AsyncStateInfo> awaitFunc) { _awaitFunc = awaitFunc; _info = new AsyncStateInfo(); }
private void IsRoundEnd(AsyncStateInfo state) { state.IsComplete = _cameraAnimator.GetCurrentAnimatorStateInfo(0).IsName("RewardGameCamera") && _cameraAnimator.GetCurrentAnimatorStateInfo(0).speed <= _animationSpeed; }
private void IsRoundStart(AsyncStateInfo state) { state.IsComplete = _cameraAnimator.GetCurrentAnimatorStateInfo(0).IsName("StartGameCamera") && _cameraAnimator.GetCurrentAnimatorStateInfo(0).speed >= _animationSpeed; }
private void AwaitFunc(AsyncStateInfo state) { // todo: game complete condition; state.IsComplete = CardDealerController.IsFinishGameRound; }