public void CreateNpcPoint()
        {
            var List = MiniMapHelp.GetInstanceAllNpc(m_CurSceneId);

            for (int i = 0; i < List.Count; i++)
            {
                var  info  = List[i];
                uint state = NpcHelper.GetNpcTaskState((uint)info.Id, m_CurSceneId);//npcId
                if (IsDisplayNpcByTaskState(state))
                {
                    var rect = GetItem(m_NpcPoint);
                    UpdateOneNpc(state, rect.gameObject);
                    Vector3 vect = new Vector3((info.Position.x - minX) / uiScalex, (info.Position.z - minY) / uiScaley, 0);
                    rect.localPosition = vect;
                    Text nameText = UIHelper.FindChild(rect.gameObject, "NameText").GetComponent <Text>();
                    nameText.text = info.BlackName;
                    Button btn = rect.GetComponent <Button>();
                    btn.onClick.RemoveAllListeners();
                    btn.onClick.AddListener(() => { OnClickNpcPoint(info); });
                    mNpcListPointObjs.Add((uint)info.Id, rect.gameObject);
                }
            }
        }
示例#2
0
        static int _m_GetInstanceAllNpc_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    uint instance_id = LuaAPI.xlua_touint(L, 1);

                    System.Collections.Generic.List <MiniMapPointInfo> __cl_gen_ret = MiniMapHelp.GetInstanceAllNpc(instance_id);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }