//update void Update() { if (null == owner) { return; } if (m_Table == null) { GameObject.Destroy(this.gameObject); return; } float time = Time.time - this.m_StartTime; ActionObject actionOld = currentAction; ActionObject ac = null; time = GetCurrentAction(time, out ac); currentAction = ac; List <ActionObject.Event> events = new List <ActionObject.Event>(); if (ac == null) { //over GameObject.Destroy(this.gameObject); return; } if (ac != actionOld) //add old unexcute event { if (actionOld != null) { events.AddRange(GetEvents(actionOld, cur_old_time, cur_now_time)); } } UpdateTime(time); //update time UpdateAnime(ac); //update animation events.AddRange(GetEvents(ac, cur_old_time, cur_now_time)); //add current event if (events.Count > 0) { foreach (ActionObject.Event ev in events) { if (ev.messages.Count > 0) { for (int i = 0; i < ev.messages.Count; i++) { owner.SendMessage("SkillMessage", ev.messages[i].m_Function + ";" + ev.messages[i].m_Args); } } EffectController effectController = null; if (ev.effect.id != string.Empty) { if (ev.effect.onoff) { //create effect effectController = EffectManager.I.Create(owner, ev.effect, this.m_HitData, target); if (effectController != null) { //todo } } } if (ev.hit.onoff) { GfxObject tmpTarget = null; if (ev.hit.isTarget) { tmpTarget = target; } HitController hitController = HitController.Create(owner, ev.hit, this.m_HitData, effectController, tmpTarget); if (hitController != null) { //todo #if UNITY_EDITOR //action editor if (EditorSceneManager.GetActiveScene().name == "Assets/Scripts/Editor/CharacterEffectEditor.unity") { int damage_num = (int)(UnityEngine.Random.value * 1000f); // HitNumber.SetData(hitController.transform.position, damage_num, HitNumberType.HpDown); } #endif } } if (!string.IsNullOrEmpty(ev.sound)) { //play sound } } } return; }