public override bool CheckCondition(TriggerInfo triggerInfo, TriggerCondInfo condInfo) { CharacterInfo charInfo = triggerInfo.charInfo; float animTime = charInfo.attackTime; //float animTime = AnimationCache.getInstance().getAnimation(charInfo.charName).getMeshAnimation(charInfo.actionName).getAnimTime(); if (animTime == null) { Debug.Log("Error:Can not get correct animTime"); return(false); } //Debug.Log("EffectTime = " + triggerInfo.EffectTime); condInfo.isConditionMatch = triggerInfo.EffectTime >= animTime; return(condInfo.isConditionMatch); }
public void LoadDataWithConfig(TriggerConfigData data) { int index = 0; foreach (ConfigData condition in data.conditions) { index++; TriggerCondInfo condInfo = new TriggerCondInfo(index); condInfo.triggerInfo = this; condInfo.LoadDataWithConfig(condition); condInfos.Add(condInfo); } index = 0; foreach (ConfigData effect in data.effects) { index++; TriggerEffectInfo effectInfo = new TriggerEffectInfo(index); effectInfo.triggerInfo = this; effectInfo.LoadDataWithConfig(effect); effectInfos.Add(effectInfo); } }
public virtual void ResetCondition(TriggerInfo triggerInfo, TriggerCondInfo condInfo) { condInfo.isConditionMatch = false; }
public virtual bool CheckCondition(TriggerInfo triggerInfo, TriggerCondInfo condInfo) { return(true); }
public virtual bool IsLifeOver(TriggerInfo triggerInfo, TriggerCondInfo condInfo) { //Debug.Log("triggerInfo Id = "+triggerInfo.Id+"IsLifeOver EffectCount = " + triggerInfo.EffectCount + "\n"); return(triggerInfo.EffectCount > 0); }
public override bool CheckCondition(TriggerInfo triggerInfo, TriggerCondInfo condInfo) { return(condInfo.isConditionMatch); }