IEnumerator _ExpProcess(body_SC_ATTR_EXP data) { AsNpcEntity monster = AsEntityManager.Instance.GetNpcEntityBySessionId(data.nNpcIdx); while(true) { yield return null; if(monster == null) break; if(monster.GetProperty<bool>(eComponentProperty.LIVING) == false) break; } AsUserEntity other = AsEntityManager.Instance.GetUserEntityByUniqueId(data.nCharUniqKey); if(/*null == monster ||*/ null == other) { Debug.Log("AsCommonProcess::ReceiveExp: entity received exp is not found"); } else { AsUserEntity user = AsUserInfo.Instance.GetCurrentUserEntity(); if(other.UniqueId == user.UniqueId) { AsUserInfo.Instance.SavedCharStat.totExp_ = data.nAddExp + data.nTotExp; AsHUDController hud = null; GameObject go = AsHUDController.Instance.gameObject; if( null != go) { hud = go.GetComponent<AsHUDController>(); hud.panelManager.ShowNumberPanel( data.nAddExp, AsPanelManager.eCustomFontType.eCustomFontType_EXP1); } } other.SetProperty( eComponentProperty.LEVEL, data.nLevel); other.SetProperty( eComponentProperty.TOTAL_EXP, data.nTotExp); #region - hud - if( null != AsHudDlgMgr.Instance ) { if( true == AsHudDlgMgr.Instance.IsOpenPlayerStatus ) AsHudDlgMgr.Instance.playerStatusDlg.ResetPageText(); } #endregion if(showLog_ == true) Debug.Log( "Level : " + data.nLevel + "\n" + "TotExp : " + data.nTotExp + "\n" + "AddExp : " + data.nAddExp); } }
private void RecieveExp( byte[] _packet) { body_SC_ATTR_EXP data = new body_SC_ATTR_EXP(); data.PacketBytesToClass( _packet); StartCoroutine("_ExpProcess", data); }