Exemplo n.º 1
0
    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("");
        }
    }
Exemplo n.º 2
0
    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());
    }