public static void AddTapOn2DObject(GameObject go, LuaFunction func) { if (go.GetComponent <SceneSelectable>() == null && go.activeSelf) { SceneSelectable com = go.AddComponent <SceneSelectable>(); com.luaCallBack = func; com.onTaped.AddListener( (finger, gameObject) => { if (com.luaCallBack != null) { com.luaCallBack.Call <GameObject, LeanFinger>(gameObject, finger); } } ); } }
void DoSelect(LeanFinger finger, SceneSelectable selectable) { if (selectable == null) { LuaManager luaMgr = AppFacade.Instance.GetManager <LuaManager>(); if (luaMgr == null) { return; } luaMgr.CallFunction("ScreenTap", finger); } else { if (selectable.onTaped != null) { selectable.onTaped.Invoke(finger, selectable.gameObject); } } }