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 IEnumerator Action1() { SystemManager.GetInstance().sceneTouchEnabled = false; LayerManager.GetInstance().AddPopUpView <GuideWindow>(); GirlEntity2D girl = GameObject.FindGameObjectWithTag(TagDefines.TAG_GIRL).GetComponent <GirlEntity2D>(); girl.Play(AnimationDefs.Sleep.ToString().ToLower()); LayerMaskDefines.GUIDE.ToLayer(girl.gameObject); yield return(new WaitForSeconds(4f)); Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip> AnimationCompleted = null; AnimationCompleted = (tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip) => { girl.componentsHolder.GetComponent(ComponentDefs.Body).animator.AnimationCompleted -= AnimationCompleted; task.Stop(); task = new Task(Action2()); GuideWindow guideWin = LayerManager.GetInstance().GetPopUpView <GuideWindow>(); guideWin.FadeOut(); }; girl.componentsHolder.GetComponent(ComponentDefs.Body).animator.AnimationCompleted += AnimationCompleted; girl.componentsHolder.GetComponent(ComponentDefs.Body).Play(AnimationDefs.Wake.ToString().ToLower()); }
private IEnumerator Action4() { SystemManager.GetInstance().sceneTouchEnabled = false; UserManager.GetInstance().OpenFunction(FunctionType.Weapon); UserManager.GetInstance().OpenFunction(FunctionType.Dungeon); FunctionData functionData = UserManager.GetInstance().GetFunction(FunctionType.Dungeon); EventBox.Send(CustomEvent.HOME_SHOW_FUNCTION, functionData); EventBox.EventBoxHandler OnWindowOpen = null; OnWindowOpen = delegate(object data) { if (data == typeof(DungeonSelectWindow)) { EventBox.Remove(CustomEvent.WINDOW_OPEN, OnWindowOpen); SystemManager.GetInstance().sceneTouchEnabled = true; GuideManager.GetInstance().FinishGuide(GuideScriptID.G01); task.Stop(); } }; EventBox.Add(CustomEvent.WINDOW_OPEN, OnWindowOpen); yield return(new WaitForSeconds(1.0f)); GirlEntity2D girl = GameObject.FindGameObjectWithTag(TagDefines.TAG_GIRL).GetComponent <GirlEntity2D>(); girl.weaponLauncher.Unload(); girl.componentsHolder.GetComponent(ComponentDefs.Body).Play(AnimationDefs.Amaze.ToString().ToLower()); }
private GirlEntity2D CreateGirlEntity(GirlData girlData) { GirlEntity2D entity = ResourceUtils.GetComponent <GirlEntity2D>(GlobalDefinitions.RESOURCE_PATH_GIRL + girlData.resourceID); entity.BindData(girlData); LayerManager.GetInstance().AddObject(entity.transform); entity.transform.position = mapWrapper.girlSpawnPoint.Value; return(entity); }
private IEnumerator Restore() { yield return(new WaitForSeconds(1.0f)); GirlEntity2D girl = owner as GirlEntity2D; girl.componentsHolder.GetComponent(ComponentDefs.Body).Play(AnimationDefs.Idle.ToString().ToLower()); girl.weaponLauncher.Load(UserManager.GetInstance().user.GetActiveWeapon()); EventBox.Send(CustomEvent.DUNGEON_SKILL_RESUME); }
private IEnumerator Action2() { yield return(new WaitForSeconds(1f)); GirlEntity2D girl = GameObject.FindGameObjectWithTag(TagDefines.TAG_GIRL).GetComponent <GirlEntity2D>(); LayerMaskDefines.GIRL.ToLayer(girl.gameObject); girl.Flip(); yield return(new WaitForSeconds(1f)); girl.Flip(); yield return(new WaitForSeconds(1f)); FunctionData functionData = new FunctionData(); functionData.id = (int)FunctionType.Weapon; EventBox.Send(CustomEvent.HOME_SHOW_FUNCTION, functionData); yield return(new WaitForSeconds(1.0f)); Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip> AnimationCompleted = null; AnimationCompleted = (tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip) => { girl.componentsHolder.GetComponent(ComponentDefs.Body).animator.AnimationCompleted -= AnimationCompleted; task.Stop(); task = new Task(Action3()); }; girl.componentsHolder.GetComponent(ComponentDefs.Body).animator.AnimationCompleted += AnimationCompleted; girl.componentsHolder.GetComponent(ComponentDefs.Body).Play(AnimationDefs.Puzzle.ToString().ToLower()); }
protected override IEnumerator RunProcessor() { for (int index = 0; index < waveAmount; index++) { Fire(); yield return(new WaitForSeconds(0.2f)); if (index == 3) { GirlEntity2D girl = owner as GirlEntity2D; girl.componentsHolder.GetComponent(ComponentDefs.Body).Play(AnimationDefs.Idle.ToString().ToLower()); girl.weaponLauncher.Load(UserManager.GetInstance().user.GetActiveWeapon()); LayerManager.GetInstance().RemovePopUpView <GuideWindow>(); EventBox.Send(CustomEvent.DUNGEON_SKILL_RESUME); } } Cancel(); }
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); }
void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { ConfigWeaponSlotI(); } else if (Input.GetKeyDown(KeyCode.Alpha2)) { ConfigWeaponSlotII(); } else if (Input.GetKeyDown(KeyCode.Alpha3)) { ConfigWeaponSlotIII(); } if (Input.GetKeyDown(KeyCode.Q)) { GirlEntity2D girlEntity = DungeonManager.GetInstance().girlEntity; Vector3 position = Camera.main.ScreenToWorldPoint(Input.mousePosition); if (girlEntity != null && !UICamera.isOverUI) { WeaponData weapon = UserManager.GetInstance().user.weaponSlotI; if (weapon != null && weapon.skillData != null) { girlEntity.ApplySkill(position, weapon.skillData); } } } else if (Input.GetKeyDown(KeyCode.W)) { GirlEntity2D girlEntity = DungeonManager.GetInstance().girlEntity; Vector3 position = Camera.main.ScreenToWorldPoint(Input.mousePosition); if (girlEntity != null && !UICamera.isOverUI) { WeaponData weapon = UserManager.GetInstance().user.weaponSlotII; if (weapon != null && weapon.skillData != null) { girlEntity.ApplySkill(position, weapon.skillData); } } } else if (Input.GetKeyDown(KeyCode.E)) { GirlEntity2D girlEntity = DungeonManager.GetInstance().girlEntity; Vector3 position = Camera.main.ScreenToWorldPoint(Input.mousePosition); if (girlEntity != null && !UICamera.isOverUI) { WeaponData weapon = UserManager.GetInstance().user.weaponSlotIII; if (weapon != null && weapon.skillData != null) { girlEntity.ApplySkill(position, weapon.skillData); } } } }