public void HandleOnAdLeavingApplication(object sender, EventArgs args)
 {
     var props = new Value();
     props["admobunitid"] = adBannerId;
     props["event"] = "admob-showbanner-leaveapp";
     Mixpanel.Track("admob-banner-event", props);
 }
 public void HandleOnAdClosed(object sender, EventArgs args)
 {
     var props = new Value();
     props["admobunitid"] = adBannerId;
     props["event"] = "admob-showbanner-closed";
     Mixpanel.Track("admob-banner-event", props);
 }
Esempio n. 3
0
        public override void Show(bool ignoreShowAnimation = false)
        {
            base.Show(ignoreShowAnimation);
            Mixpanel.Track("Unity/LoginImpression");

            for (var i = 0; i < slots.Length; i++)
            {
                var slot       = slots[i];
                var playerSlot = slot.GetComponent <LoginPlayerSlot>();

                if (States.Instance.AvatarStates.TryGetValue(i, out var avatarState))
                {
                    playerSlot.LabelLevel.text = $"LV.{avatarState.level}";
                    playerSlot.LabelName.text  = avatarState.NameWithHash;
                    playerSlot.CreateView.SetActive(false);
                    playerSlot.NameView.SetActive(true);
                }
                else
                {
                    playerSlot.CreateView.SetActive(true);
                    playerSlot.NameView.SetActive(false);
                }
            }

            AudioController.instance.PlayMusic(AudioController.MusicCode.SelectCharacter);
        }
Esempio n. 4
0
        public IObservable <ActionBase.ActionEvaluation <CombinationEquipment> > CombinationEquipment(
            int recipeId,
            int slotIndex,
            int?subRecipeId = null)
        {
            Mixpanel.Track("Unity/Create CombinationEquipment");

            // 결과 주소도 고정되게 바꿔야함
            var action = new CombinationEquipment
            {
                AvatarAddress = States.Instance.CurrentAvatarState.address,
                RecipeId      = recipeId,
                SubRecipeId   = subRecipeId,
                SlotIndex     = slotIndex,
            };

            ProcessAction(action);

            return(_renderer.EveryRender <CombinationEquipment>()
                   .Where(eval => eval.Action.Id.Equals(action.Id))
                   .Take(1)
                   .Last()
                   .ObserveOnMainThread()
                   .Timeout(ActionTimeout)
                   .DoOnError(e => HandleException(action.Id, e)));
        }
Esempio n. 5
0
        private void GoToCombinationEquipmentRecipe(int recipeId)
        {
            Mixpanel.Track("Unity/Click Guided Quest Combination Equipment");

            CombinationClickInternal(() =>
                                     Find <Combination>().ShowByEquipmentRecipe(recipeId));
        }
Esempio n. 6
0
        public void CreateAndLogin(string nickName)
        {
            if (!Regex.IsMatch(nickName, GameConfig.AvatarNickNamePattern))
            {
                Find <Alert>().Show("UI_ERROR", "UI_NICKNAME_CONDITION");
                return;
            }

            Mixpanel.Track("Unity/Choose Nickname");
            Find <GrayLoadingScreen>().Show();

            Game.Game.instance.ActionManager
            .CreateAvatar(_selectedIndex, nickName, _hair,
                          _lens, _ear, _tail)
            .Subscribe(eval =>
            {
                var avatarState = States.Instance.SelectAvatar(_selectedIndex);
                StartCoroutine(CreateAndLoginAnimation(avatarState));
                ActionRenderHandler.Instance.RenderQuest(avatarState.address,
                                                         avatarState.questList.completedQuestIds);

                //[TentuPlay]
                new TPStashEvent().CharacterLogin(
                    player_uuid: States.Instance.AgentState.address.ToHex(),
                    character_uuid: States.Instance.CurrentAvatarState.address.ToHex().Substring(0, 4)
                    );
            },
                       e =>
            {
                ActionRenderHandler.PopupError(e);
                Find <GrayLoadingScreen>().Close();
            });
            AudioController.PlayClick();
        }
Esempio n. 7
0
        public void DropComplete(bool value)
        {
            if (!value)
            {
                return;
            }

            dropCompleteCounter += 1;

            // if all objects have dropped, graph line chart
            if (dropCompleteCounter == objectsList.Count)
            {
                graphCreator.CreateGraph();
                dropCompleteCounter = 0;

                // show feedback
                if (gameController)
                {
                    gameController.ShowFeedbackPopup(10);
                }

                // track
                var props = new Value();
                props["Scene Name"] = SceneManager.GetActiveScene().name;
                Mixpanel.Track("Ran Simulation", props);
            }
        }
Esempio n. 8
0
        private IEnumerator showFeedbackPopupCoroutine(float delaySeconds)
        {
            yield return(new WaitForSeconds(delaySeconds));

            // instantiate feedback popup
            feedbackPopup = (GameObject)Instantiate(feedbackPopupPrefab, new Vector3(0, 0, 0), Quaternion.identity);
            feedbackPopup.GetComponent <FeedbackPopupController>().GameController = this;

            positionPopup(feedbackPopup);

            if (audioSource)
            {
                audioSource.clip = showFeedbackPopupClip;
                audioSource.Play();
            }

            // set to seen
            PlayerPrefs.SetInt("hasSeenFeedbackPopup", 1);

            // vibrate both controllers
            TouchHaptics.Instance.VibrateFor(0.25f, 0.2f, 0.2f, OVRInput.Controller.Touch);

            popUpOpen = true;

            var props = new Value();

            props["Scene Name"] = SceneManager.GetActiveScene().name;
            Mixpanel.Track("Shown Feedback Popup", props);
        }
Esempio n. 9
0
        public void PowerButtonPress()
        {
            if (!powerOn)
            {
                powerOn        = true;
                powerText.text = "Power On";
                mainLight.TurnOn(true);
                //setCurrents(sliderControl.SliderValue);
                currentQueue.Add(sliderControl.SliderValue);
            }
            else
            {
                powerOn        = false;
                powerText.text = "Power Off";
                mainLight.TurnOn(false);
                //setCurrents(0);
                currentQueue.Add(0);

                // show feedback popup
                if (gameController)
                {
                    gameController.ShowFeedbackPopup(5);
                }
            }

            var props = new Value();

            props["Scene Name"] = SceneManager.GetActiveScene().name;
            props["Power On"]   = powerOn;
            Mixpanel.Track("Power Button Press", props);
        }
        void Start()
        {
            if (UnityEngine.XR.XRDevice.model == "Oculus Quest")
            {
                controllerRayCaster.RayCastEnabled = true;
                controllerRayCaster.EnableLineRenderer(true);
            }

            // once we have registered users we can use a better ID
            Mixpanel.Identify(getUniqueID());
            Mixpanel.People.Set("Headset", UnityEngine.XR.XRDevice.model);

            // set random name
            Mixpanel.People.SetOnce("$name", getRandomName());

            var props = new Value();

            props["Scene Name"] = SceneManager.GetActiveScene().name;
            Mixpanel.Track("Opened Scene", props);

            //Mixpanel.StartTimedEvent("App Session");

            if (PlayerPrefs.GetInt("hasEnteredWelcomeEmail") == 1)
            {
                feedbackPopup.SetActive(false);
            }
            else
            {
                feedbackPopup.SetActive(true);
            }

            TouchHaptics.Instance.VibrateFor(0.25f, 0.2f, 0.2f, OVRInput.Controller.Touch);
        }
Esempio n. 11
0
        public void End()
        {
            PlayerFactory.Create();

            if (PlayerPrefs.HasKey(LoginDetail.RecentlyLoggedInAvatarKey))
            {
                var recentlyLoggedAddress = PlayerPrefs.GetString(LoginDetail.RecentlyLoggedInAvatarKey);
                var matchingAddress       = State.States.Instance.AgentState.avatarAddresses
                                            .FirstOrDefault(pair => pair.Value.ToString().Equals(recentlyLoggedAddress));
                var index = matchingAddress.Equals(default(KeyValuePair <int, Address>)) ? -1 : matchingAddress.Key;

                try
                {
                    State.States.Instance.SelectAvatar(index);
                    Game.Event.OnRoomEnter.Invoke(false);
                }
                catch (KeyNotFoundException e)
                {
                    Debug.LogWarning(e.Message);
                    EnterLogin();
                }
            }
            else
            {
                EnterLogin();
            }

            Mixpanel.Track("Unity/Synopsis End");
            Close();
        }
 // Use this for initialization
 void Start () {
     RequestBanner();
     var props = new Value();
     props["admobunitid"] = adBannerId;
     props["event"] = "admob-showbanner";
     Mixpanel.Track("admob-banner", props);
 }
Esempio n. 13
0
    void OnGUI()
    {
        GUI.skin = this.skin;

        GUILayout.BeginArea(new Rect(Screen.width * 0.3f, Screen.height * 0.35f, Screen.width * 0.4f, Screen.height * 2.5f));

        if (GUILayout.Button("Track"))
        {
            // a simple tracking call
            Mixpanel.Track("The Button Was Clicked1");
        }

        if (GUILayout.Button("Engage")) // an engage call
        {
            Mixpanel.people.Increment("clicks", 1);
        }

        if (GUILayout.Button("Opt Out Tracking")) // an engage call
        {
            Mixpanel.OptOutTracking();
            //  EditorUtility.DisplayDialog("Opt status", "Has opted out:  " + Mixpanel.hasOptedOut() , "Ok");
        }

        if (GUILayout.Button("Opt In Tracking")) // an engage call
        {
            Mixpanel.OptInTracking();
            // var args1 = new Value();
            // args1["test"] = 100;
            // args1["me"] = 101;
            // Mixpanel.OptInTracking("newDisctinctId2", args1);
            // EditorUtility.DisplayDialog("Opt status", "Has opted out:  " + Mixpanel.hasOptedOut() , "Ok");
        }

        GUILayout.EndArea();
    }
Esempio n. 14
0
    public void CommentUploaded()
    {
        var properties = new Value();

        SetAppState(properties);

        Mixpanel.Track("New Comment Added To Post", properties);
    }
Esempio n. 15
0
    public void NextArrowSelected()
    {
        var properties = new Value();

        SetAppState(properties);

        Mixpanel.Track("Next Posts Selected", properties);
    }
Esempio n. 16
0
    public void FollowSelected()
    {
        var properties = new Value();

        SetAppState(properties);

        Mixpanel.Track("Began Following User", properties);
    }
Esempio n. 17
0
    public void PreviousArrowSelected()
    {
        var properties = new Value();

        SetAppState(properties);

        Mixpanel.Track("Previous Posts Selected", properties);
    }
Esempio n. 18
0
    // Use this for initialization
    void Start()
    {
        MobileAds.Initialize(appId);
        var props = new Value();

        props["admobappid"] = appId;
        props["event"]      = "admob-initialize";
        Mixpanel.Track("admob-initialize", props);
    }
Esempio n. 19
0
    public void CommentSelected(int sphereNumber)
    {
        var properties = new Value();

        properties["SphereNumber"] = sphereNumber;
        SetAppState(properties);

        Mixpanel.Track("Post Comments Opened", properties);
    }
Esempio n. 20
0
    public void CaptionSelected(int sphereNumber)
    {
        var properties = new Value();

        properties["SphereNumber"] = sphereNumber;
        SetAppState(properties);

        Mixpanel.Track("Caption Selected For Editing", properties);
    }
Esempio n. 21
0
    public void HandleSelected(int sphereNumber)
    {
        var properties = new Value();

        properties["SphereNumber"] = sphereNumber;
        SetAppState(properties);

        Mixpanel.Track("Profile Opened From Post", properties);
    }
Esempio n. 22
0
    public void ImageSphereSelected(int sphereNumber)
    {
        var properties = new Value();

        properties["SphereNumber"] = sphereNumber;
        SetAppState(properties);

        Mixpanel.Track("Post Image Selected For Viewing", properties);
    }
Esempio n. 23
0
    public void mySDKInitialized(string unitId)
    {
        Debug.Log("GGMOPUBTEST my SDK initialized" + unitId);
        var props = new Value();

        props["mopubunitid"] = bannerIds[0];
        props["event"]       = "initialize-success";
        Mixpanel.Track("mopub-initialize", props);
    }
Esempio n. 24
0
 protected override void OnApplicationQuit()
 {
     if (Mixpanel.IsInitialized())
     {
         Mixpanel.Track("Unity/Player Quit");
         Mixpanel.Flush();
     }
     _logsClient?.Dispose();
 }
    public void myOnAdLoaded(string unitId, float id)
    {
        Debug.Log("GGMOPUBTEST onAdLoaded delegate" + unitId);
        var props = new Value();

        props["mopubunitid"] = bannerId;
        props["event"]       = "showinterstitial-success";
        Mixpanel.Track("mopub-interstitial", props);
    }
        public void StartStopCart()
        {
            if (!rollerCoasterCart)
            {
                return;
            }

            if (rollerCoasterController.IsRunning())
            {
                  {
                    modelPlayButton.SetActive(true);
                    modelStopButton.SetActive(false);

                    // update texts
                    additionalText.text = prevAdditionalText;
                    sizeText.text       = prevSizeText;
                    nameText.text       = prevNameText;

                    operationInProgress = false;

                    previewItemsList[currentItemIndex].SetActive(true);

                    // show feedback
                    if (gameController)
                    {
                        gameController.ShowFeedbackPopup(10);
                    }

                    // track
                    var props = new Value();

                    props["Scene Name"] = SceneManager.GetActiveScene().name;
                    Mixpanel.Track("Ran Simulation", props);
                }
            }
            else
            {
                modelPlayButton.SetActive(false);
                modelStopButton.SetActive(true);

                // update text fields
                prevAdditionalText = additionalText.text;
                prevSizeText       = sizeText.text;
                prevNameText       = nameText.text;

                additionalText.text = "Roller Coaster ride in progress. Press Stop button to stop.";
                sizeText.text       = "";
                nameText.text       = "";

                operationInProgress = true;

                previewItemsList[currentItemIndex].SetActive(false);
            }

            rollerCoasterController.StartStopCart();
        }
    public void myOnAdFailed(string unitId, string error)
    {
        Debug.Log("GGMOPUBTEST onAdFailed delegate" + unitId + "with error" + error);
        var props = new Value();

        props["mopubunitid"] = unitId;
        props["event"]       = "showinterstitial-failed";
        props["reason"]      = error;
        Mixpanel.Track("mopub-interstitial", props);
    }
Esempio n. 28
0
    public void OnTrackPress()
    {
        count++;
        text.SetText($"Clicked {count}");

        Value props = new Value();

        props["count"] = count;
        Mixpanel.Track("Clicked", props);
    }
Esempio n. 29
0
        private void openBrowser(string url)
        {
            var props = new Value();

            props["Scene Name"] = SceneManager.GetActiveScene().name;
            Mixpanel.Track("Opened Survey", props);

            Application.OpenURL(url);
            closePopup();
        }
Esempio n. 30
0
        public override void Show(bool ignoreShowAnimation = false)
        {
            base.Show(ignoreShowAnimation);
            Mixpanel.Track("Unity/Synopsis Start");
            AudioController.instance.PlayMusic(AudioController.MusicCode.Prologue);
            var skipPrologue = States.Instance.AgentState.avatarAddresses.Any();

            skipButton.SetActive(skipPrologue);
            StartCoroutine(StartSynopsis(skipPrologue));
        }