private IEnumerator SwitchAnimation(GlobalCharacterInfo.CHAR_TYPE originType, GlobalCharacterInfo.CHAR_TYPE switchType) { //모든 설정 초기화. moveScript.ResetCharacterInfo(); //Hold & Imune 설정 moveScript.SetHold(); moveScript.SetInvInvincibility(); // 우선 스프라이트가 위에서 설정되서 내려온다 // Effect Script On 변경할 캐릭터가 내려와야함. Debug.Log(originType); Debug.Log(switchType); effectScript.SetModeFalldown(switchType, moveScript.IsRight()); //캐릭터 공중에 올려놓는다. //캐릭터가 지면에 닿을동안 대기. yield return(new WaitUntil(() => effectScript.IsLanding() == true)); //닿으면 연기 Effect 설정. //캐릭터 변경. effectScript.SetModeDisappear(originType, moveScript.IsRight()); moveScript.setCharacterType(switchType); //연기 effect 와 동시에 캐릭터 왼쪽 오른쪽 여부 판단하여 애니메이션 작동 yield return(new WaitUntil(() => effectScript.IsEndAni() == true)); //모든 애니메이션 동작 완료 시 해당 다시 Release moveScript.ReleaseHold(); moveScript.ReleaseInvincibility(); }
private IEnumerator DragonSkill() { GameObject breathObject = MonoBehaviour.Instantiate(dragonBreathPrefab) as GameObject; DragonSkillModel skillModel = new DragonSkillModel(); skillModel.appreanceFrame = defaultSkillInfo.m_sSkillBullet.dragonSkill.eachDuration; skillModel.gapFrame = defaultSkillInfo.m_sSkillBullet.dragonSkill.gapDuration; skillModel.isRight = moveScript.IsRight(); skillModel.sheetingFrame = defaultSkillInfo.m_sSkillBullet.dragonSkill.eachDuration; skillModel.sheetingSprite = dragonLaserSprite; skillModel.sheetingSpriteStart = dragonSparkSprite; skillModel.stretchXMax = defaultSkillInfo.m_sSkillBullet.dragonSkill.laserXArea; skillModel.stretchXMin = defaultSkillInfo.m_sSkillBullet.dragonSkill.sparkXArea; skillModel.targetArray = new ArrayList(); skillModel.targetArray.Add(GlobalLayerMask.ENEMY_MASK);; float offsetValue = breathObject.GetComponent <CapsuleCollider2D>().size.x / 2 * breathObject.transform.localScale.x; float charSizeX = moveScript.GetCurrentSize().x; breathObject.transform.position = new Vector3( moveScript.GetCurrentPostion().x + (moveScript.IsRight()? offsetValue : -offsetValue) + charSizeX, moveScript.GetCurrentPostion().y, moveScript.GetCurrentPostion().z); breathObject.transform.localScale = new Vector3(moveScript.IsRight() ? 1 : -1, 1, 1); BreathScript breathScript = breathObject.GetComponent <BreathScript>(); breathScript.SetParameter(skillModel); yield return(new WaitUntil(() => breathScript.EndSkill() == true)); Destroy(breathObject); moveScript.ReleaseInvincibility(); moveScript.ReleaseHold(); duringSkill = false; }