Beispiel #1
0
        UnaryResult <EventResult> IStoreService.SendEvent(ActionEvent t)
        {
            Console.WriteLine(t.ToString());
            // fake hash calculation just for testing, should hash from store state.
            // var bytes = System.Text.Encoding.UTF8.GetBytes(t.ToString());
            // t.Hash = Convert.ToBase64String(_hasher.ComputeHash(bytes));
            var response = new EventResult {
                Id = t.Id, Status = EventStatus.Accepted
            };

            return(new UnaryResult <EventResult>(response));
        }
    /**
     * This is how you can send events to the Webview
     * position is the final pointer position on the underlying 2D Webview
     * It is android coordinate system: top,left = 0,0 / bottom,right = textureHeight,textureWidth
     * See the `Event system` section below for implementation example
     */
    public void SendEvent(Vector2 position, ActionEvent actionType)
    {
        if (propagateHitEvent == false)
        {
            return;
        }
        DebugMessage("Send event to Webview: Type=" + actionType.ToString() + " (" + (int)position.x + "," + (int)position.y + ")");
        if (view != null)
        {
            view.Call("eventAdd", (int)position.x, (int)position.y, (int)actionType);
        }
        else
        {
#if !UNITY_EDITOR
            Debug.LogError("WARNING: Send Event view is null");
#endif
        }
    }
 private void AddEventline(string ev, ActionEvent a)
 {
     string[] evSplit = ev.Split('.');
     if (evSplit.Length > 1)
     {
         if (!Eventline.ContainsKey(ev)) Eventline.Add(ev, new List<ActionEvent>());
         if (!Eventline[ev].Contains(a)) Eventline[ev].Add(a);
     }
     else
     {
         ev = a.BEC.Behavior.Id + "." + ev;
         if (!Eventline.ContainsKey(ev)) Eventline.Add(ev, new List<ActionEvent>());
         if (!Eventline[ev].Contains(a)) Eventline[ev].Add(a);   
     }
     DebugIf("behaviorSchedule", "AddEventline " + ev + ": " + a.ToString());
 }
 private void AddTimeline(float time, ActionEvent a)
 {
     if (!Timeline.ContainsKey(time)) Timeline.Add(time, new List<ActionEvent>());
     if (!Timeline[time].Contains(a)) Timeline[time].Add(a);
     DebugIf("behaviorSchedule", "AddTimeline " + time + ": " + a.ToString());
 }