コード例 #1
0
        public void TargetChanged(IChapterTarget target)
        {
            if (!string.IsNullOrEmpty(target.getXApiClass()) && target.getXApiClass() == "accesible")
            {
                TrackerAsset.Instance.Accessible.Accessed(target.getId(), ExParsers.ParseEnum <AccessibleTracker.Accessible>(target.getXApiType()));
                TrackerAsset.Instance.Flush();
            }

            UpdateCompletables(completableController => completableController.UpdateMilestones(target));
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: dotlive/uAdventure
        private void trackSceneChange(IChapterTarget target)
        {
            if (!string.IsNullOrEmpty(target.getXApiClass()) && target.getXApiClass() == "accesible")
            {
                TrackerAsset.Instance.Accessible.Accessed(target.getId(), ExParsers.ParseEnum <AccessibleTracker.Accessible>(target.getXApiType()));
                TrackerAsset.Instance.Flush();
            }

            CompletablesController.Instance.TargetChanged(target);
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: Victorma/Compluaventuras
        private void trackSceneChange(IChapterTarget target)
        {
            alternative = null;

            if (!string.IsNullOrEmpty(target.getXApiClass()))
            {
                if (target.getXApiClass() == "accesible")
                {
                    Tracker.T.accessible.Accessed(target.getId(), ParseEnum <AccessibleTracker.Accessible>(target.getXApiType()));
                }
                else if (target.getXApiClass() == "alternative")
                {
                    alternative = target;
                }
            }

            CompletableController.Instance.targetChanged(target);

            Tracker.T.RequestFlush();
        }
コード例 #4
0
        private void TraceExit(bool exited, IChapterTarget targetOnExit)
        {
            var ed = area.Element as Exit;

            // ALTERNATIVE
            if ("alternative".Equals(targetOnExit.getXApiClass(), IgnoreCase))
            {
                var parsedType = (AlternativeTracker.Alternative)Enum.Parse(typeof(AlternativeTracker.Alternative), targetOnExit.getXApiType(), true);
                if (ConditionChecker.check(ed.getConditions()))
                {
                    if (targetOnExit.getXApiType() == "menu")
                    {
                        TrackerAsset.Instance.Alternative.Selected(targetOnExit.getId(), ed.getNextSceneId(), parsedType);
                    }
                    else
                    {
                        TrackerAsset.Instance.setSuccess(true);
                        TrackerAsset.Instance.Alternative.Selected(targetOnExit.getId(), ed.getNextSceneId(), parsedType);
                    }
                }
                else
                {
                    if (targetOnExit.getXApiType() != "menu")
                    {
                        TrackerAsset.Instance.setSuccess(false);
                        TrackerAsset.Instance.Alternative.Selected(targetOnExit.getId(), "Incorrect", parsedType);
                    }
                }
                TrackerAsset.Instance.Flush();
            }

            // ACCESIBLE

            // If no exited, accesible doesnt matter
            if (!exited)
            {
                return;
            }

            // If no destination accesible doesnt matter
            var destination = Game.Instance.GameState.GetChapterTarget(ed.getNextSceneId());

            if (destination == null)
            {
                return;
            }

            if ("accesible".Equals(destination.getXApiClass(), IgnoreCase))
            {
                var type = ExParsers.ParseDefault(destination.getXApiType(), AccessibleTracker.Accessible.Accessible);
                TrackerAsset.Instance.Accessible.Accessed(destination.getId(), type);
            }
        }
コード例 #5
0
        private TrackerAsset.TrackerEvent TraceExit(bool exited, IChapterTarget targetOnExit)
        {
            if (!TrackerAsset.Instance.Started)
            {
                return(null);
            }

            var ed = area.Element as Exit;

            // ALTERNATIVE
            if ("alternative".Equals(targetOnExit.getXApiClass(), IgnoreCase))
            {
                var parsedType = (AlternativeTracker.Alternative)Enum.Parse(typeof(AlternativeTracker.Alternative), targetOnExit.getXApiType(), true);
                if (ConditionChecker.check(ed.getConditions()))
                {
                    if (targetOnExit.getXApiType() == "menu")
                    {
                        return(TrackerAsset.Instance.Alternative.Selected(targetOnExit.getId(), ed.getNextSceneId(), parsedType));
                    }
                    else
                    {
                        TrackerAsset.Instance.setSuccess(true);
                        return(TrackerAsset.Instance.Alternative.Selected(targetOnExit.getId(), ed.getNextSceneId(), parsedType));
                    }
                }
                else
                {
                    if (targetOnExit.getXApiType() != "menu")
                    {
                        TrackerAsset.Instance.setSuccess(false);
                        return(TrackerAsset.Instance.Alternative.Selected(targetOnExit.getId(), "Incorrect", parsedType));
                    }
                }
            }
            return(null);
        }