Beispiel #1
0
    private void FinishPrint()
    {
        AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.PrintFinished);
        AudioAgent.StopSoundEffect(AudioAgent.SoundEffectType.Print);
        AudioAgent.PlaySoundEffect(AudioAgent.SoundEffectType.PrintFinish);

        ChangeState(State.Finished);
    }
Beispiel #2
0
    private void OnShareAreaTouch()
    {
        wasSharing = true;

        AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.Share);

        StartCoroutine("DoShare");
    }
Beispiel #3
0
    /*
     * void OnGUI()
     * {
     *      GUI.Label( new Rect( 10f, 10f, 1000f, 1000f ), "" + currentState );
     * }
     */

    private void OnRestartAreaTouch()
    {
        wasRestarting = true;

        if (currentState != State.Finished)
        {
            AudioAgent.StopSoundEffect(AudioAgent.SoundEffectType.Print);
            AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.PrintFinished);
        }

//		ChangeState( State.Advertising );
        ChangeState(State.Ready);
    }
Beispiel #4
0
    private IEnumerator DoNavigation(float toX)
    {
        if (currentState == State.Printing)
        {
            ChangeState(State.Paused);
        }

        float fromX       = CameraAgent.MainCameraObject.transform.localPosition.x;
        float currentTime = 0f;
        float lerp;

        do
        {
            currentTime += Time.deltaTime;
            lerp         = Mathf.Clamp01(currentTime / navigationDuration);

            lerp = Mathf.Pow(lerp, 0.5f);

            //lerp = 3f * Mathf.Pow( lerp, 2f ) - 2f * Mathf.Pow( lerp, 3f );

            SetCameraX(Mathf.Lerp(fromX, toX, lerp));

            yield return(null);
        } while(currentTime < navigationDuration);

        SetCameraX(toX);

        UpdateNavigationHighlight(true);

        if (currentState == State.Ready && currentScreenX == 0f)
        {
            SetUIEnabled(false);
            TipAgent.SetTipEnabled(true);
            UpdateNavigationHighlight(true);
        }

        if (currentScreenX < 0f)
        {
            AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.SettingsScreen);
        }

        if (currentScreenX > 0f)
        {
            AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.StoreScreen);
        }
    }
Beispiel #5
0
    private IEnumerator WaitForAdSuccess(int spriteIndexToUnlock)
    {
        hasWatchedAd = false;

        while (!hasWatchedAd)
        {
            yield return(null);
        }

        UnlockSprite(spriteIndexToUnlock);

        SetSpriteIndex(spriteIndexToUnlock);

        AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.UnlockSprite);
//		PreferencesAgent.UpdateICloud();

        CheckAllSpritesUnlocked();
    }
Beispiel #6
0
    private void OnMoreAreaTouch()
    {
        AnalyticsAgent.LogAnalyticEvent(AnalyticsAgent.AnalyticEvent.More);

        Application.OpenURL("http://mostnights.com/");
    }