public void PlayAnim(eAnimName aniType) { if (UnitAnim != null && UnitAnim.Animation != null) { UnitAnim.PlayAnim(aniType); } }
public bool PlayAnimationVoice(eAnimName anim) { if (AnimDatas.Length <= (int)anim || AnimDatas[(int)anim] == null) { //Debug.LogError("animation effect index error " + anim); return(false); } uint voiceSoundID; Resource.AniInfo aniData = AnimDatas[(int)anim]; if (aniData.voice.Count >= 1) { int voiceSoundArrayIdx = Random.Range(0, aniData.voice.Count); voiceSoundID = uint.Parse(aniData.voice[voiceSoundArrayIdx].ToString()); } else { voiceSoundID = uint.Parse(aniData.voice[0].ToString()); } SoundManager.instance.PlayVoiceSound(voiceSoundID); return(true); }
public bool IsPlaying(eAnimName anim) { if (UnitAnim != null && UnitAnim.IsPlaying(anim)) { return(true); } return(false); }
public bool IsPlaying(eAnimName animEvent) { if (Animation == null) { return(false); } return(Animation.IsPlaying(GetAnimName(animEvent))); }
/// <summary> /// 주어진 시간 동안 velocity 방향으로 pushPower 만큼 민다. /// </summary> public override void Push(eAnimName animName, Vector3 _velocity, float pushPower, float duration, float stiffenTime, UnitState _next = UnitState.Idle) { float pushDur = duration; _stiffenTime = stiffenTime; // 애니메이션 유무에 따라 그냥 밀리는지 설정 if (animName != eAnimName.Anim_none) { if (parent.PlayAnim(animName, false, 0, true)) { float speed = 0.7f; if (animName == eAnimName.Anim_damage) { AnimationState state = parent.Animator.Animation[parent.Animator.GetAnimName(animName)]; state.speed = speed; } // 밀리는 시간만 조절하도록 한다. //pushDur = (parent.Animator.GetAnimLength(animName) + ((1 - speed) * parent.Animator.GetAnimLength(animName))); } else { pushDur = 0.25f; // 애니메이션이 없거나 플레이 실패시 고정시간 밀리기. } } if (animName == eAnimName.Anim_damage) { //데미지 표시일경우 Resource.AniInfo aniInfo = parent.GetAniData(eAnimName.Anim_damage); SoundManager.instance.PlaySfxUnitSound(aniInfo.seSkill, parent._audioSource, parent.cachedTransform); } else if (animName == eAnimName.Anim_down) { //데미지 표시일경우 Resource.AniInfo aniInfo = parent.GetAniData(eAnimName.Anim_down); SoundManager.instance.PlaySfxUnitSound(aniInfo.seSkill, parent._audioSource, parent.cachedTransform); } //< 이동하는 방향을 자신의 뒤로 설정 Vector3 newForward = -_velocity; newForward.y = 0; parent.cachedTransform.forward = newForward.normalized; //< 도착할 위치 지정 pushPower = pushPower * (1 / pushDur); velocity = _velocity.normalized * pushPower; //< 종료 시점 지정 stateEndTime = pushEndTime = Time.time + pushDur; stateEndTime += stiffenTime; nextState = _next; startedPush = true; }
public uint GetAnimationSound(eAnimName anim) { if (AnimDatas.Length <= (int)anim || AnimDatas[(int)anim] == null) { //Debug.LogError("animation effect index error " + anim); return(0); } return(AnimDatas[(int)anim].seSkill); }
/// <summary> 애니메이션에 맞는 이펙트 이름 </summary> public string GetAnimationEffect(eAnimName anim) { if (AnimDatas.Length <= (int)anim || AnimDatas[(int)anim] == null) { Debug.LogError("animation effect index error " + anim); return(null); } return(AnimDatas[(int)anim].effect); }
/// <summary> 애니메이션에 맞는 사운드 </summary> public void PlayAnimationSound(eAnimName anim) { if (AnimDatas.Length <= (int)anim || AnimDatas[(int)anim] == null) { Debug.LogError("Play Animation Sound error " + anim); return; } SoundManager.instance.PlaySfxSound(AnimDatas[(int)anim].seSkill); }
public float GetAnimLength(eAnimName animEvent) { string animName = GetAnimName(animEvent); if (AnimLength.ContainsKey(animName)) { return(AnimLength[animName]); } return(0.5f); }
public string GetAnimName(eAnimName animEvent) { if (AnimDatas == null) { return("1"); } if (AnimDatas.Length <= (int)animEvent || AnimDatas[(int)animEvent] == null) { return("1"); } return(AnimDatas[(int)animEvent].aniName); }
public override bool PlayAnim(eAnimName animEvent, bool CrossFade = false, float CrossTime = 0.1F, bool canPlaySameAnim = false, bool queued = false) { bool doPlaying = base.PlayAnim(animEvent, CrossFade, CrossTime, canPlaySameAnim, queued); if (false == doPlaying) { return(doPlaying); } //Resource.AniInfo aniInfo = ads[(int)animEvent]; //if (UsableNavAgent && rootMotion != null) // rootMotion.Play(Animator.CurrentAnimState, aniInfo.rootMotion); return(true); }
public override bool PlayAnim(eAnimName animEvent, bool CrossFade = false, float CrossTime = 0.1f, bool canPlaySameAnim = false, bool queued = false) { bool doPlaying = base.PlayAnim(animEvent, CrossFade, CrossTime, canPlaySameAnim, queued); if (false == doPlaying) { return(doPlaying); } //일단 임시!!! bool ignoreEnemy = false; if (CurrentState == UnitState.Skill) { ActionInfo actionIfno = SkillCtlr.SkillList[UseSkillSlot].GetSkillActionInfo(); if (actionIfno != null) { if (actionIfno.skillpass == 0) { ignoreEnemy = false; } else { ignoreEnemy = true; } } else { ignoreEnemy = false; } } else { ignoreEnemy = false; } Resource.AniInfo aniInfo = CharInfo.animDatas[(int)animEvent]; if (UsableNavAgent && rootMotion != null) { rootMotion.Play(Animator.CurrentAnimState, aniInfo.rootMotion, ignoreEnemy); } return(true); }
/// <summary> /// 뜨는시간, 떨어지는 시간을 제외한 체공시간 계산하기 /// </summary> public void Floating(Vector3 direction, float power, float _height = 1.5f, float _duration = 0.0f) { if (curInternalState == State.Begin) { return; } animName = eAnimName.Anim_floating; parent.PlayAnim(animName, true, 0.08f, true); floatAnimState = parent.Animation[parent.Animator.GetAnimName(animName)]; if (floatAnimState == null) { parent.ChangeState(UnitState.Idle); return; } //< 들어왔다면 이펙트는 삭제시켜줌 parent.EffectClear(true); animLength = floatAnimState.length; halfAnimLength = animLength * 0.5f; stateEndTime = Time.time + animLength + _duration; // 회전시키기 //direction.y = 0; //parent.transform.forward = -direction.normalized; // 푸시관련 Push(Mathf.Max(1f, power), animLength - landingTime); // 상태 시작. curInternalState = State.Begin; floatingHeight = _height; floatDuration = _duration; curHeight = targetTrans.localPosition.y; time = 0f; nextState = UnitState.StandUp; }
public virtual bool PlayAnim(eAnimName animEvent, bool crossFade = false, float crossTime = 0.1f, bool canPlaySameAnim = false, bool queued = false, bool StopCheck = false) { if (IsPlaying(animEvent) && !canPlaySameAnim) { return(false); } // die Animation 중에는 Animation 변경 불가 if (!canPlaySameAnim && CurrentAnim == eAnimName.Anim_die && animEvent != eAnimName.Anim_die && !parent.Usable) { return(false); } if (null == Animation) { Debug.LogWarning("애니메이션을 플레이할 수 있는 객체가 존재하지 않습니다."); return(false); } if (!StopCheck) { string animName = GetAnimName(animEvent); //if (parent != null) // Debug.LogWarning(parent.CurCombo + " : " + animName); if (!PlayAnim(animName, crossFade, crossTime, queued)) { return(false); } } else { ChangeAniCheck = true; } return(true); }
public override bool PlayAnim(eAnimName animEvent, bool CrossFade = false, float CrossTime = 0.1f, bool canPlaySameAnim = false, bool queued = false) { bool doPlaying = base.PlayAnim(animEvent, CrossFade, CrossTime, canPlaySameAnim, queued); if (false == doPlaying) { return(doPlaying); } //몬스터의 경우 일단 난투장에선 RootMotion을 안씀 bool bRootMotion = CharInfo.animDatas[(int)animEvent].rootMotion; if (G_GameInfo.GameMode == GAME_MODE.FREEFIGHT) { bRootMotion = false; } if (UsableNavAgent && rootMotion != null) { rootMotion.Play(Animator.CurrentAnimState, bRootMotion); } return(true); }
public override bool PlayAnimNoRootMation(eAnimName animEvent, bool CrossFade = false, float CrossTime = 0.1f, bool canPlaySameAnim = false, bool queued = false) { return(base.PlayAnim(animEvent, CrossFade, CrossTime, canPlaySameAnim, queued)); }
public GameObject PlayAniSoundAndEff(Transform parentTf, eAnimName anim, float particleSize, bool is2D = false) { if (UnitAnim == null) { return(null); } UnitAnim.PlayAnimationSound(anim); UnitAnim.PlayAnimationVoice(anim); string effName = UnitAnim.GetAnimationEffect(anim); if (string.IsNullOrEmpty(effName)) { return(null); } string path = null; if (gameObject.name.Contains("par")) { if (gameObject.name.Contains("makgyeran")) { path = "_PARTNER/mak_gyeran"; } else { string[] split = effName.Split('_'); int length = 0, arr = 0; for (int i = 0; i < split.Length; i++) { if (length < split[i].Length)//제일 긴 것이 이름일 것이다. { length = split[i].Length; arr = i; } } path = string.Format("_PARTNER/{0}", split[arr]); } if (gameObject.name.Contains("jopunghwa")) { SetWeaponEffectActive(false); } } else if (gameObject.name.Contains("pc")) { if (gameObject.name.Contains("pc_f")) { path = string.Format("_PC/fighter"); } else if (gameObject.name.Contains("pc_p")) { path = string.Format("_PC/pojol"); } else if (gameObject.name.Contains("pc_d")) { path = string.Format("_PC/doctor"); } } Object obj = Resources.Load(string.Format("Effect/{0}/{1}", path, effName)); GameObject effGo = null; if (obj != null) { effGo = Instantiate(obj) as GameObject; CheckRenderQ(RenderQ, effGo.transform); List <ParticleSystem> list = UIHelper.FindComponents <ParticleSystem>(effGo.transform); ResettingParticle(null, list, particleSize); } if (effGo == null) { return(null); } NGUITools.SetChildLayer(effGo.transform, LayerMask.NameToLayer("UI")); effGo.SetActive(true); effGo.transform.parent = parentTf; effGo.transform.localPosition = Vector3.zero; effGo.transform.localScale = Vector3.one; effGo.transform.localEulerAngles = is2D ? new Vector3(10, 0, 0) : Vector3.zero;//Quaternion.Euler(Vector3.zero); return(effGo); }
/// <summary> /// 주어진 시간 동안 velocity 방향으로 pushPower 만큼 민다. /// </summary> public virtual void Push(eAnimName animName, Vector3 _velocity, float pushPower, float animTime, float stiffenTime, UnitState _next = UnitState.Idle) { }
/// <summary> /// 2개 실행 시킬때 사용. /// </summary> /// <param name="nowAniType">지금 실행할 애니</param> /// <param name="queueAniType">다음에 실행할 애니</param> /// <param name="crossTime">몇초?</param> public void CrossFadeAnimation(eAnimName nowAniType, eAnimName queueAniType, float crossTime = 0.1f) { UnitAnim.PlayAnim(nowAniType); UnitAnim.PlayAnim(queueAniType, true, crossTime, true, true, false); }
public Resource.AniInfo GetAnimData(eAnimName animEvent) { return(animDatas[(int)animEvent]); }
IEnumerator EventUpdate(CutSceneEventData __CutSceneEventData) { List <CutSceneEventDataList> EventList = new List <CutSceneEventDataList>(); for (int i = 0; i < __CutSceneEventData.EventList.Length; i++) { EventList.Add(__CutSceneEventData.EventList[i]); } int DefaultIdx = -1; for (int i = 0; i < EventList.Count; i++) { if (EventList[i].ActionType == eCutSceneEvent.SetRaidStartDefault) { DefaultIdx = i; break; } } if (DefaultIdx != -1) { EventList.Insert(DefaultIdx + 1, CreateCutSceneEventDataList(eCutSceneEvent.StartUpdate, Vector3.zero)); EventList.Insert(DefaultIdx + 1, CreateCutSceneEventDataList(eCutSceneEvent.SetRaidDefaultPos, Vector3.zero)); EventList.Insert(DefaultIdx + 1, CreateCutSceneEventDataList(eCutSceneEvent.SetFadeOut, Vector3.zero)); EventList.Insert(DefaultIdx + 1, CreateCutSceneEventDataList(eCutSceneEvent.StopUpdate, Vector3.zero)); } Unit unit = null; for (int i = 0; i < EventList.Count; i++) { //Debug.Log("EventList ActionType " + EventList[i].ActionType); switch (EventList[i].ActionType) { #region 이전데이터 //< 카메라 포커싱처리 case eCutSceneEvent.Focusing: if (EventList[i].ActionBool) { if (G_GameInfo.GameInfo.FocusingCam != null) { G_GameInfo.GameInfo.FocusingCam.StartEffect(0, true); } } else { if (G_GameInfo.GameInfo.FocusingCam != null && G_GameInfo.GameInfo.FocusingCam.gameObject.activeSelf) { G_GameInfo.GameInfo.FocusingCam.EndEffect(true); } } break; //< 사운드 실행 case eCutSceneEvent.PlayBgmSound: //SoundHelper.PlayBgmSound((uint)EventList[i].ActionValue); break; //< 보스 UI 출력 case eCutSceneEvent.ShowBossUI: if (null == UIMgr.GetUI("InGame/BossCutscenePanel")) { UIMgr.Open("InGame/BossCutscenePanel", EventList[i].ActionValue); } break; //< 기본 셋트 한번에 다해줌 case eCutSceneEvent.SetDefaultBoss: //< 포커싱처리 G_GameInfo.GameInfo.FocusingCam.StartEffect(0, true); //< 사운드실행 //SoundHelper.PlayBgmSound(9008); unit = CutSceneMgr.CutSceneEventDic[0].GetComponent <Unit>(); G_GameInfo.GameInfo.FocusingCam.AddObject(unit.gameObject); //< 보스 유아이 실행 //if (null == UIMgr.GetUI("InGame/BossCutscenePanel")) // UIMgr.Open("InGame/BossCutscenePanel", (float)3); //< 해당 애니메이션 플레이 시간을 얻는다. eAnimName aniName2 = GetAniName("Anim_intro"); if (aniName2 != eAnimName.Anim_idle) { EventList[i].ActionDelay = unit.Animator.GetAnimLength(aniName2) + 1; } //EventList[i].ActionDelay += unit.Animator.GetAnimLength(eAnimName.Anim_special); Sequence.Duration = EventList[i].ActionDelay + 0.5f; USTimelineProperty Infolist = Sequence.GetComponentInChildren <USTimelineProperty>(); //CutSceneMgr.seq.Duration=EventList[i].ActionDelay+0.5f; //UI 라이트를 컨트롤 한다. 다시 켜주는 건 CutSceneMgr 에 있음. EndScene 마지막 Transform Shadow; Shadow = GameObject.Find("UI_ShadowLight").GetComponent <Transform> (); USTimelineContainer Container = Sequence.CreateNewTimelineContainer(Shadow); GameObject test = new GameObject("Evnet Timeline"); test.transform.parent = Container.transform; Component Evnt = test.AddComponent("USTimelineEvent"); GameObject First = new GameObject("USEnableComponentEvent"); GameObject Second = new GameObject("USEnableComponentEvent"); First.transform.parent = Evnt.transform; Second.transform.parent = Evnt.transform; First.AddComponent("USEnableComponentEvent"); Second.AddComponent("USEnableComponentEvent"); First.GetComponent <USEnableComponentEvent> ().ComponentName = "Light"; //Second.GetComponent<USEnableComponentEvent> ().ComponentName = "Light"; //Second.GetComponent<USEnableComponentEvent> ().enableComponent=true; First.GetComponent <USEnableComponentEvent> ().FireTime = 0.0f; //Second.GetComponent<USEnableComponentEvent> ().FireTime = Sequence.Duration; // Infolist.Properties [0].curves [0].Keys[1].Time = 0.7f; Infolist.Properties [0].curves [1].Keys [1].Time = 0.7f; Infolist.Properties [0].curves [2].Keys [1].Time = 0.7f; Infolist.Properties [1].curves [0].Keys[1].Time = 0.7f; Infolist.Properties [1].curves [1].Keys [1].Time = 0.7f; Infolist.Properties [1].curves [2].Keys [1].Time = 0.7f; Infolist.Properties [1].curves [3].Keys [1].Time = 0.7f; Infolist.Properties [0].curves [0].Keys[3].Time = Sequence.Duration + 10; Infolist.Properties [0].curves [1].Keys [3].Time = Sequence.Duration + 10; Infolist.Properties [0].curves [2].Keys [3].Time = Sequence.Duration + 10; Infolist.Properties [1].curves [0].Keys[3].Time = Sequence.Duration + 10; Infolist.Properties [1].curves [1].Keys [3].Time = Sequence.Duration + 10; Infolist.Properties [1].curves [2].Keys [3].Time = Sequence.Duration + 10; Infolist.Properties [1].curves [3].Keys [3].Time = Sequence.Duration + 10; Infolist.Properties [0].curves[0].Keys[2].Time = Sequence.Duration; Infolist.Properties [0].curves [1].Keys [2].Time = Sequence.Duration; Infolist.Properties [0].curves [2].Keys [2].Time = Sequence.Duration; Infolist.Properties [1].curves [0].Keys[2].Time = Sequence.Duration; Infolist.Properties [1].curves [1].Keys [2].Time = Sequence.Duration; Infolist.Properties [1].curves [2].Keys [2].Time = Sequence.Duration; Infolist.Properties [1].curves [3].Keys [2].Time = Sequence.Duration; break; #endregion 이전데이터 //< 해당 위치로 강제이동 case eCutSceneEvent.ImmediatelyMove: CutSceneMgr.CutSceneEventDic[0].transform.position = EventList[i].ActionPos; break; //< 이펙트 실행 case eCutSceneEvent.SpawnEffect: SpawnEffect(EventList[i]); break; //< 카메라 쉐이킹 case eCutSceneEvent.CameraShake: CutSceneMgr.Shake((byte)EventList[i].ActionValue); break; //< 보스 UI 출력 case eCutSceneEvent.ShowRaidBossUI: if (null == UIMgr.GetUI("InGame/BossCutscenePanel")) { UIMgr.Open("InGame/BossCutscenePanel", EventList[i].ActionValue); } break; //< 보스 대화 출력 case eCutSceneEvent.RaidBossTalk: unit = CutSceneMgr.CutSceneEventDic[0].GetComponent <Unit>(); G_GameInfo.GameInfo.StartCoroutine(RaidBossTalkUpdate(unit, EventList[i].ActionString)); break; //< 애니메이션 실행 case eCutSceneEvent.AnimaionPlay: unit = CutSceneMgr.CutSceneEventDic[(int)EventList[i].ActionValue].GetComponent <Unit>(); if (unit != null) { eAnimName aniName = GetAniName(EventList[i].ActionString); unit.PlayAnim(aniName, false, 0.2f, true); //< 해당 애니메이션 플레이 시간을 얻는다. if (aniName != eAnimName.Anim_idle) { EventList[i].ActionDelay = unit.Animator.GetAnimLength(aniName) - 0.2f; } } else { //< 유닛이 없다면 그냥 바로 실행시켜준다. CutSceneMgr.CutSceneEventDic[(int)EventList[i].ActionValue].animation.CrossFade(EventList[i].ActionString, 0.5f); } break; //< 플레이 자체는 멈춰둔다. case eCutSceneEvent.StopUpdate: CutSceneMgr.seq.Pause(); break; case eCutSceneEvent.StartUpdate: CutSceneMgr.seq.Play(); break; //< 페이드 인(밝아지는처리) case eCutSceneEvent.SetFadeIn: CutSceneMgr.seq.Pause(); yield return(G_GameInfo._GameInfo.StartCoroutine(_CameraFadeEventObj.FadeInUpdate())); CutSceneMgr.seq.Play(); //< 스킵버튼 체크한다. SetSkipPanel(); break; //< 페이드 아웃(어두워지는 처리) case eCutSceneEvent.SetFadeOut: if (_CameraFadeEventObj == null) { _CameraFadeEventObj = (Instantiate(Resources.Load("Camera/CameraFadeEvent")) as GameObject).GetComponent <CameraFadeEvent>(); _CameraFadeEventObj.transform.parent = CutSceneMgr.startCamObj.transform; _CameraFadeEventObj.transform.localPosition = new Vector3(0, 0, 1); _CameraFadeEventObj.transform.localRotation = Quaternion.identity; } GameObject panel = UIMgr.GetUI("CutSceneSkipPanel"); if (panel != null) { panel.GetComponent <UIBasePanel>().Close(); } yield return(G_GameInfo._GameInfo.StartCoroutine(_CameraFadeEventObj.FadeOutUpdate())); break; //< 레이드를 위한 기본 카메라 위치 셋팅 case eCutSceneEvent.SetRaidDefaultPos: CutSceneMgr.startRootObj.transform.position = Vector3.zero; CutSceneMgr.startRootObj.transform.rotation = Quaternion.identity; CutSceneMgr.startCamObj.transform.parent = CutSceneMgr.startRootObj.transform; CutSceneMgr.startCamObj.transform.localPosition = Vector3.zero; CutSceneMgr.startCamObj.transform.localRotation = Quaternion.identity; break; case eCutSceneEvent.SetActive: CutSceneMgr.CutSceneEventDic[(int)EventList[i].ActionValue].SetActive(EventList[i].ActionBool); break; case eCutSceneEvent.SetTimeScale: SetTimeScale(EventList[i]); break; } //< 딜레이동안 대기 yield return(new WaitForSeconds(EventList[i].ActionDelay)); } yield return(null); }