private static string CreateUseEffectText(CUseEffectHandle effect) { if (effect == null) { return(""); } if (effect is CUseEffect) { return(CUseEffectExplain.CreateUseEffectText(effect as CUseEffect)); } else if (effect is CRandomUseEffect) { return(CRandomUseEffectExplain.CreateRandomUseEffectText(effect as CRandomUseEffect)); } else if (effect is CMakeObjectUseEffect) { Debug.LogWarning("Warning : no return value"); return(""); } else { Debug.LogWarning("Warning : undefined effect type"); return(""); } }
public static string CreateRandomUseEffectText(CRandomUseEffect randomEffect) { if (randomEffect == null) { return(""); } StringBuilder sb = new StringBuilder(); foreach (var effectWithChance in randomEffect.Effects) { sb.Append($"{effectWithChance.persantChance}% 확률로 " + CUseEffectExplain.CreateUseEffectText(effectWithChance.effect)); } return(sb.ToString()); }