public override void EnterScene() { TransitionEngine.onTransitionComplete += OnTransitionComplete; TransitionEngine.onScreenObscured += OnScreenObscured; UserData user = UserManager.GetInstance().user; DisassemblygirlDungeonConfig config = ConfigMgr.GetInstance().DisassemblygirlDungeon.GetConfigById(currentDungeonIndex); dungeon = DungeonData.FromConfig(config); CreateMap(dungeon.resourceID); girlEntity = CreateGirlEntity(user.girl); girlEntity.Play(AnimationDefs.Idle.ToString().ToLower()); petEntity = CreatePetEntity(user.GetActivePet()); if (petEntity != null) { petEntity.Flip(); } LayerManager.GetInstance().AddPopUpView <DungeonWindow>(); LayerManager.GetInstance().AddPopUpView <DungeonReadyBar>(); }
private void OnUserApplyPet(object data) { PetData petData = data as PetData; if (petEntity != null) { petEntity.Dispose(); petEntity = null; } petEntity = CreatePetEntity(petData); }
private void OnPetLevelUp(object data) { PetData petData = data as PetData; if (petEntity != null) { if (UserManager.GetInstance().user.activePetID == petData.id) { petEntity.Dispose(); petEntity = null; petEntity = CreatePetEntity(petData); } } }
private PetEntity2D CreatePetEntity(PetData petData) { if (petData == null) { return(null); } PetEntity2D entity = ResourceUtils.GetComponent <PetEntity2D>(GlobalDefinitions.RESOURCE_PATH_PET + petData.resourceID); entity.BindData(petData); LayerManager.GetInstance().AddObject(entity.transform); entity.transform.position = mapWrapper.petSpwanPoint.Value; return(entity); }
public override void EnterScene() { CameraManager.GetInstance().openCamera(CameraType.Guide); UserData user = UserManager.GetInstance().user; TransitionEngine.onTransitionComplete += OnTransitionComplete; TransitionEngine.onScreenObscured += OnScreenObscured; CreateMap(); girlEntity = CreateGirlEntity(user.girl); girlEntity.Flip(); petEntity = CreatePetEntity(user.GetActivePet()); LayerManager.GetInstance().AddPopUpView <HomeWindow>(); SoundManager.GetInstance().PlayBackgroundMusic(AudioRepository.BG_HOME.AsAudioClip(), 1.0f); EventBox.Send(CustomEvent.HOME_SHOW_FUNCTIONS); GuideManager.GetInstance().Trigger(GuideScriptID.G01); }