void _Packet(ScDropRole p) { moduleGlobal.UnLockUI(); if (p.result == 0) { var index = roleList.FindIndex(r => r.roleId == operatorRole); if (index != -1) { var arr = new PRoleSummary[roleList.Length - 1]; var m = 0; for (var i = 0; i < roleList.Length; i++) { if (i != index) { arr[m++] = roleList[i]; } else { roleList[i].Destroy(); } } roleList = arr; DispatchEvent(RoleListChangeEvent); } } DispatchModuleEvent(Response_DeleteRole, p); }
private void OnDeleteRole(ScDropRole msg) { if (msg.result != 0) { return; } deletePanel.UnInitialize(); RfreshUILayout(); _currentIndex = -1; CurrentIndex = moduleSelectRole.FindIndex(_currentRoleId); }