예제 #1
0
        static int _m_OnClicked(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            NpcPlayer __cl_gen_to_be_invoked = (NpcPlayer)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.OnClicked(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
예제 #2
0
        //--------------------------------------------------------
        //  客户端消息
        //--------------------------------------------------------
        private void OnNpcClicked(CEventBaseArgs args)
        {
            if (args == null || args.arg == null)
            {
                return;
            }

            if (UIInputEvent.TouchedUI() == true)
            {
                return;
            }

            GameObject npcObject = args.arg as GameObject;

            if (npcObject == null)
            {
                return;
            }

            var mono = ActorHelper.GetActorMono(npcObject.gameObject);

            if (mono == null)
            {
                return;
            }

            NpcPlayer targetNpc = mono.BindActor as NpcPlayer;

            if (targetNpc == null)
            {
                return;
            }

            // 点击npc后已经取消任务的导航了,所以要把导航任务清空
            TaskManager.Instance.NavigatingTask = null;

            //MissionManager.Instance.NotifyMetNpc((uint)targetNpc.NpcData.Id);
            targetNpc.OnClicked();
        }