| | |
| | |
|
| | | Action m_HeroSkillCompletet;
|
| | |
|
| | | SFXController m_SkillExtraSfx;
|
| | |
|
| | | public int cacheSkillId { get; private set; }
|
| | |
|
| | | public Camera showCamera { get { return m_ShowCamera; } }
|
| | |
| | | });
|
| | | var _clip = _index != -1 ? _treasureSkill.clip[_index] : _treasureSkill.clip[0];
|
| | | ShowHeroSkill(_skillId, _clip.clip);
|
| | | if (_treasureSkill.effects != null && _treasureSkill.effects.Count > 0)
|
| | | {
|
| | | _index = _treasureSkill.effects.FindIndex((x) =>
|
| | | {
|
| | | return (int)x.job == PlayerDatas.Instance.baseData.Job;
|
| | | });
|
| | | var _effect = _index != -1 ? _treasureSkill.effects[_index] : _treasureSkill.effects[0];
|
| | | StartCoroutine(Co_PlayExtraEffect(_effect));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | StopShow();
|
| | | }
|
| | |
|
| | | IEnumerator Co_PlayExtraEffect(Effect effect)
|
| | | {
|
| | | yield return new WaitForSeconds(effect.startTime);
|
| | | if (m_SkillExtraSfx != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_SkillExtraSfx);
|
| | | m_SkillExtraSfx = null;
|
| | | }
|
| | | var parent = hero;
|
| | | if (!string.IsNullOrEmpty(effect.parentName) && hero != null)
|
| | | {
|
| | | parent = hero.GetChildTransformDeeply(effect.parentName, true);
|
| | | }
|
| | | m_SkillExtraSfx = SFXPlayUtility.Instance.Play(effect.id, parent);
|
| | | if (m_SkillExtraSfx != null)
|
| | | {
|
| | | m_SkillExtraSfx.duration = effect.duration;
|
| | | m_SkillExtraSfx.transform.localPosition = effect.position;
|
| | | }
|
| | | }
|
| | |
|
| | | public void StopShow()
|
| | | {
|
| | | UI3DTreasureSelectStage.Instance.showCamera.enabled = true;
|
| | | m_ShowCamera.gameObject.SetActive(false);
|
| | | m_HeroSkillCompletet = null;
|
| | | m_HeroShow.Dispose();
|
| | | if (m_SkillExtraSfx != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_SkillExtraSfx);
|
| | | m_SkillExtraSfx = null;
|
| | | }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | |
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public struct Effect
|
| | | {
|
| | | public PlayerJob job;
|
| | | public int id;
|
| | | public float startTime;
|
| | | public float duration;
|
| | | public string parentName;
|
| | | public Vector3 position;
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public struct TreasureSkill
|
| | | {
|
| | | public int treasureId;
|
| | | public List<CameraClip> clip;
|
| | | public List<Effect> effects;
|
| | | }
|
| | |
|
| | | public enum PlayerJob
|