/** Check if we match a specific event for a specific gameobject */ public bool QueryHits(nCamera c, nInputEvent e, GameObject o) { var rtn = false; var hits = _hits[c]; if (e == nInputEvent.DOWN) { if (Input.GetMouseButtonDown(0) && Intersects(hits, o)) rtn = true; } else if (e == nInputEvent.UP) { if (Input.GetMouseButtonUp(0) && Intersects(hits, o)) rtn = true; } else if (e == nInputEvent.ENTER) { if (_prevHits.ContainsKey(c)) { var lhits = _prevHits[c]; if (Intersects(hits, o) && (!Intersects(lhits, o))) { rtn = true; } } } else if (e == nInputEvent.EXIT) { if (_prevHits.ContainsKey(c)) { var lhits = _prevHits[c]; if (!Intersects(hits, o) && (Intersects(lhits, o))) rtn = true; } } return rtn; }
/** Check if we match a specific event for a specific gameobject */ public static bool Query(nCamera c, nInputEvent e, GameObject o) { var i = nInputHandler.Get(); i.UpdateHits (c); return i.QueryHits(c, e, o); }