public Msg_PetDataIndicate(PetAppearData _data, bool _display) { m_MessageType = eMessageType.PET_DATA_INDICATE; data_ = _data; display_ = _display; }
public void SetCreationData( PetAppearData _data) { m_SessionId = -1; sessionId_ = -1; Tbl_Pet_Record petRec = AsTableManager.Instance.GetPetRecord( _data.nPetTableIdx_); if( petRec == null) { Debug.LogError( "AsNpcEntity::SetCreatioinData: NO pet table PET RECORD"); return; } m_iTableIdx = _data.nPetTableIdx_; SetProperty( eComponentProperty.CLASS, petRec.Class); string name = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( _data.szPetName_)); SetProperty( eComponentProperty.NAME, name); SetProperty( eComponentProperty.PET_ID, petRec.Index); SetProperty( eComponentProperty.LEVEL, _data.nLevel_); // Tbl_PetLevel_Record lvRec = AsTableManager.Instance.GetPetLevelRecord( _data.nLevel_); // SetProperty( eComponentProperty.EVOLUTION_LEVEL, lvRec.EvolutionLv); // SetProperty( eComponentProperty.MOVING, false); // SetProperty( eComponentProperty.MOVE_TYPE, false); // SetProperty( eComponentProperty.MOVE_SPEED, false); Vector3 pos = _data.owner_.GetRandomValidPosisionInRange( AsBaseEntity.s_PetRange); SetRePosition( pos); transform.rotation = _data.owner_.transform.rotation; }
public Msg_PetDataIndicate( PetAppearData _data)//, AsNpcEntity _pet) { m_MessageType = eMessageType.PET_DATA_INDICATE; data_ = _data; // pet_ = _pet; }
public AsNpcEntity PetAppear( PetAppearData _appear) { AsNpcEntity entity = null; GameObject obj = new GameObject( "Pet"); entity = obj.AddComponent<AsNpcEntity>(); entity.AttachComponent( m_dicEntityTemplate["Pet"]); entity.InitComponents(); obj.transform.parent = m_RootObject.transform; entity.SetCreationData( _appear); entity.InterInitComponents(); entity.LateInitComponents(); entity.LastInitComponents(); return entity; }
void _PetProc( AsUserEntity _user, OtherCharacterAppearData _data) { if( _data.nPetTableIdx_ > 0) { PetAppearData appear = new PetAppearData(_user, _data); _user.HandleMessage( new Msg_PetDataIndicate( appear)); // PetAppear( appear); } }
public void PlayerEnterWorld() { if(isPetExist == true) { AsUserEntity player = AsEntityManager.Instance.UserEntity; PetAppearData appear = new PetAppearData( player, m_PetInfo); player.HandleMessage( new Msg_PetDataIndicate( appear)); // // AsEntityManager.Instance.PetAppear( appear); } }
public void Recv_PetCall( byte[] _packet) { body_SC_PET_CALL call = new body_SC_PET_CALL(); call.PacketBytesToClass( _packet); Debug.Log("AsPetManager:: Recv_PetCall: call.nPetTableIdx = " + call.nPetTableIdx); AsUserEntity user = AsEntityManager.Instance.GetUserEntityByUniqueId( call.nCharUniqKey); if( user == null) { Debug.LogWarning( "AsPetManager:: Recv_PetCall: user is not found. id = " + call.nCharUniqKey); return; } PetAppearData appear = new PetAppearData( user, call); user.HandleMessage( new Msg_PetDataIndicate( appear)); AsSoundManager.Instance.PlaySound( "Sound/Interface/S6024_EFF_Bonus", Vector3.zero, false); if(user.FsmType == eFsmType.PLAYER) { m_PetInfo.SetValue( call); // if(m_PetInfo.Hungry == ePET_HUNGRY_STATE.ePET_HUNGRY_STATE_HUNGRY) AsEntityManager.Instance.MessageToPlayer(new Msg_PetHungryIndicate()); if(m_PetDlg != null) m_PetDlg.RefreshInfoDlg(); if(m_PetManageDlg != null) m_PetManageDlg.Open(); } }