public BuffDebuffData(ConfigBuffDebuffRecord cf, AfterEffect AfterEffect, EffectData data) { this.AfterEffect = AfterEffect; this.cf = cf; this.data = data; remainTime = cf.EffectTime; }
IEnumerator Type(float startDelay, string message, float endDelay, AfterEffect action) { char[] temp = mText.text.ToCharArray(); int msgIdx = 0; if (startDelay > 0f) { yield return(new WaitForSeconds(startDelay)); } StopCoroutine("Blink"); temp[lastIdx] = BOX; mText.text = new string(temp); isOn = true; while (msgIdx < message.Length) { mText.text = mText.text.Insert(lastIdx++, message.Substring(msgIdx++, 1)); yield return(new WaitForSeconds(typeSpeed)); } StartCoroutine("Blink"); if (endDelay > 0f) { yield return(new WaitForSeconds(endDelay)); } if (action != null) { action(); } }
/// <summary> /// Creates DFRSimilarity from the three components. /// <p> /// Note that <code>null</code> values are not allowed: /// if you want no normalization or after-effect, instead pass /// <seealso cref="NoNormalization"/> or <seealso cref="NoAfterEffect"/> respectively. </summary> /// <param name="basicModel"> Basic model of information content </param> /// <param name="afterEffect"> First normalization of information gain </param> /// <param name="normalization"> Second (length) normalization </param> public DFRSimilarity(BasicModel basicModel, AfterEffect afterEffect, Normalization normalization) { if (basicModel == null || afterEffect == null || normalization == null) { throw new System.NullReferenceException("null parameters not allowed."); } this.BasicModel_Renamed = basicModel; this.AfterEffect_Renamed = afterEffect; this.Normalization_Renamed = normalization; }
public void ApplyBuffDebuff(ConfigBuffDebuffRecord cf, OnEffect OnEffect, AfterEffect AfterEffect) { foreach (var d in buffDebuffDatas) { if (d.cf.Id == cf.Id) { d.remainTime = cf.EffectTime; AddBuffDebuffEvent?.Invoke(cf.Sprite, cf.Id, cf.EffectTime); return; } } EffectData data = OnEffect.Invoke(); /* if (data != null && data.onNewEnemyAddEvent != null) * EnemyFactory.instance.OnNewEnemyAddEvent += data.onNewEnemyAddEvent;*/ buffDebuffDatas.Add(new BuffDebuffData(cf, AfterEffect, data)); AddBuffDebuffEvent?.Invoke(cf.Sprite, cf.Id, cf.EffectTime); ChangeProjectile(); }