Exemplo n.º 1
0
        private void Update()
        {
            float threshold = 2.5f;

            if (controllingChanges != -1.0f && Time.time - controllingChanges > threshold)
            {
                TrackerAsset.Instance.setVar("new_value", m_InputField.text);
                TrackerAsset.Instance.AddExtensionsToTrace(trace);
                trace.Completed();
                controllingChanges = -1.0f;
            }
        }
Exemplo n.º 2
0
 protected override void ActionFinished(object interactuable)
 {
     if (TrackerAsset.Instance.Started)
     {
         Game.Instance.GameState.EndChangeAmbitAsExtensions(trace);
         trace.Completed();
     }
 }
Exemplo n.º 3
0
            public bool execute()
            {
                var forceWait = exitEffects.execute();

                if (!forceWait)
                {
                    // Last run
                    Game.Instance.GameState.EndChangeAmbitAsExtensions(trace);
                    trace?.Completed();
                }
                return(forceWait);
            }
Exemplo n.º 4
0
        public void EndTrace()
        {
            if (trace == null)
            {
                return;
            }

            isTracePending = false;
            TrackerAsset.Instance.setSuccess(xAPISuccess);
            Game.Instance.GameState.EndChangeAmbitAsExtensions(trace);
            trace.Completed();
            Game.Instance.OnActionCanceled -= ActionCancelled;
        }
Exemplo n.º 5
0
        public void ElementInteracted(bool finished, Element element, Core.Action action)
        {
            if (element == null || !TrackerAsset.Instance.Started)
            {
                return;
            }

            if (!finished)
            {
                if (trace != null)
                {
                    Debug.LogError("An interaction has been made while another element is being interacted!!");
                }

                if (element is NPC)
                {
                    trace = TrackerAsset.Instance.GameObject.Interacted(element.getId(), GameObjectTracker.TrackedGameObject.Npc);
                }
                else if (element is Item)
                {
                    trace = TrackerAsset.Instance.GameObject.Interacted(element.getId(), GameObjectTracker.TrackedGameObject.Item);
                }
                else if (element is ActiveArea)
                {
                    trace = TrackerAsset.Instance.GameObject.Interacted(element.getId(), GameObjectTracker.TrackedGameObject.Item);
                }
                else
                {
                    trace = TrackerAsset.Instance.GameObject.Interacted(element.getId(), GameObjectTracker.TrackedGameObject.GameObject);
                }
                trace.SetPartial();
                Game.Instance.GameState.BeginChangeAmbit(trace);
                //Game.Instance.OnActionCanceled += ActionCanceled;

                UpdateElementsInteracted(element, action.getType().ToString(), element.getId());
            }
            else
            {
                string actionType = string.Empty;
                switch (action.getType())
                {
                case Core.Action.CUSTOM: actionType = (action as CustomAction).getName(); break;

                case Core.Action.CUSTOM_INTERACT: actionType = (action as CustomAction).getName(); break;

                case Core.Action.DRAG_TO: actionType = "drag_to"; break;

                case Core.Action.EXAMINE: actionType = "examine"; break;

                case Core.Action.GIVE_TO: actionType = "give_to"; break;

                case Core.Action.GRAB: actionType = "grab"; break;

                case Core.Action.TALK_TO: actionType = "talk_to"; break;

                case Core.Action.USE: actionType = "use"; break;

                case Core.Action.USE_WITH: actionType = "use_with"; break;
                }

                if (!string.IsNullOrEmpty(action.getTargetId()))
                {
                    TrackerAsset.Instance.setVar("action_target", action.getTargetId());
                }
                if (!string.IsNullOrEmpty(actionType))
                {
                    TrackerAsset.Instance.setVar("action_type", actionType);
                }

                Game.Instance.GameState.EndChangeAmbitAsExtensions(trace);
                trace.Completed();
                trace = null;
            }
        }