public static WarningResult CheckWarning(bool dirty, int warnings, FightingStyle style, double defense) { WarningResult ret = new WarningResult(); if (dirty) { bool warned = RandomGen.CheckRandom(Resources.Dirty_Warning_Percent); if (warned) { ret.IsWarned = true; ret.IsDisqualified = CheckDqed(warnings); } } else { ret.IsWarned = ret.IsWarned || RandomGen.CheckRandom(Resources.Warning_NoDirty); } if (style == FightingStyle.Clinch && defense > Resources.Clinch_MaxDefense_NoWarning) { double percent = defense - Resources.Clinch_MaxDefense_NoWarning; percent = Math.Pow(percent, 2) / 100; bool warned = RandomGen.CheckRandom(percent); if (warned) { ret.IsWarned = true; ret.IsDisqualified = ret.IsDisqualified || CheckDqed(warnings); } } return(ret); }
public void CheckFighterWarning(FighterFight fighter) { WarningResult res = CheckWarning(fighter); this.IsWarned = res.IsWarned; this.IsDisqualified = res.IsDisqualified; }
public void Active(WarningModel value) { text.text = value.value; this.result = value.result; if (value.delay >0) { Invoke("Close",value.delay); } gameObject.SetActive(true); }
public void Active(WarningModel value) { text.text = value.value; this.result = value.result; if (value.delay > 0) { Invoke("Close", value.delay); } gameObject.SetActive(true); }
WarningResult result;//回调 public void active(WarningModel value) { GetComponent <errorPanel>().showPanel(); text.text = value.value; this.result = value.result; if (value.delay > 0) { Invoke("close", value.delay); } gameObject.SetActive(true); }
private static int CheckWarnings(bool dirty, int defense, int warnings, int numTimes, bool checkDq) { int times = 0; for (int i = 0; i < numTimes; i++) { WarningResult res = FighterRound.CheckWarning(dirty, warnings, FightingStyle.Clinch, defense); if (checkDq && res.IsDisqualified) { times++; } if (!checkDq && res.IsWarned) { times++; } } return(times); }
public WarningModel(string value, WarningResult relust = null, float delay = -1) { this.value = value; this.result = relust; this.delay = delay; }
public void active(WarningModel model) { text.text = model.value; this.result = model.result; this.gameObject.SetActive(true); }
public WarningModel(string value, WarningResult result =null) { Value = value; Result = result; }
public WarningModel(string value, WarningResult result = null) { this.result = result; this.value = value; }
/// <summary> /// 弹出提示窗并显示 /// </summary> /// <param name="value"></param> public void Active(WarningModel value) { contentText.text = value.Value; result = value.Result; gameObject.SetActive(true); }
WarningResult result; // 警告托管 // 激活警告 public void active(WarningModel value) { text.text = value.value; this.result = value.result; gameObject.SetActive(true); }
public WarningModel(string value, WarningResult relust = null,float delay= -1) { this.value = value; this.result = relust; this.delay = delay; }
public static WarningResult CheckWarning(FighterFight fight) { WarningResult ret = CheckWarning(fight.RoundStats.Plan.Dirty, fight.Warnings, fight.RoundStats.Plan.Style, fight.RoundStats.Plan.Defense); return(ret); }