Exemplo n.º 1
0
    IEnumerator BeginGenerativePhase()
    {
        makingSongState.Post(gameObject);
        if (gameMode != GameMode.ViewPreviousReadings && !DEBUG_SaveReadingImmediately)
        {
            SaveUtils.SaveReading(new SavedReading(
                                      System.DateTime.Now.Ticks,
                                      cardsSelectedToDeal.ToArray(),
                                      cardMeanings,
                                      false
                                      ));
        }
        generativeUI.SetMeanings(cardMeanings);
        float       t            = 0;
        CanvasGroup readingGroup = spreadCanvas.GetComponent <CanvasGroup>();

        if (readingGroup != null)
        {
            while (t < 1.0)
            {
                t += Time.deltaTime / cardFlipSpeed;
                readingGroup.alpha = 1 - t;
                yield return(null);
            }
        }
        foreach (TarotCardData card in selectedCardData)
        {
            foreach (ParticleSystem ps in sparks)
            {
                float GetColorFromCardOrder(int order)
                {
                    return(order < 7 ? ((order + 78) * 3) / 255f : (order * 3) / 255f);
                }

                Color particleColor = new Color32();
                particleColor.r = GetColorFromCardOrder(selectedCardData[0].order);
                particleColor.g = GetColorFromCardOrder(selectedCardData[1].order);
                particleColor.b = GetColorFromCardOrder(selectedCardData[2].order);
                particleColor.a = 255;
                ParticleSystem.MainModule ma = ps.main;
                ma.startColor = particleColor;
                ps.Play();
            }
        }
        Cursor.SetCursor(waitCursor, Vector2.zero, CursorMode.Auto);
        yield return(StartCoroutine(generativeUI.FadeIn()));

        yield return(StartCoroutine(generativeUI.ReadText()));

        Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
        SetGameState(GameState.ShowingGenerativeUITransitionalText);
    }
Exemplo n.º 2
0
 void PrepForReading()
 {
     if (gameMode != GameMode.ViewPreviousReadings && DEBUG_SaveReadingImmediately)
     {
         SaveUtils.SaveReading(new SavedReading(
                                   System.DateTime.Now.Ticks,
                                   cardsSelectedToDeal.ToArray(),
                                   cardMeanings,
                                   false
                                   ));
     }
     for (int i = 0; i < cardReadingSpots.Length; i++)
     {
         cardReadingSpots[i].SetCardMeaningText(cardMeanings[i]);
     }
     enableButton = true;
     Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
     setClipNumber = 1;
 }