public static CharacterSkillUsage Create(SkillUsageType type, int dataId)
    {
        CharacterSkillUsage newSkillUsage = new CharacterSkillUsage();

        newSkillUsage.type   = type;
        newSkillUsage.dataId = dataId;
        newSkillUsage.coolDownRemainsDuration = 0f;
        return(newSkillUsage);
    }
    public static int IndexOfSkillUsage(this ICharacterData data, int dataId, SkillUsageType type)
    {
        IList <CharacterSkillUsage> list = data.SkillUsages;
        CharacterSkillUsage         tempSkillUsage;
        int index = -1;

        for (int i = 0; i < list.Count; ++i)
        {
            tempSkillUsage = list[i];
            if (tempSkillUsage.dataId == dataId && tempSkillUsage.type == type)
            {
                index = i;
                break;
            }
        }
        return(index);
    }
 public void Deserialize(NetDataReader reader)
 {
     type   = (SkillUsageType)reader.GetByte();
     dataId = reader.GetInt();
     coolDownRemainsDuration = reader.GetFloat();
 }
Ejemplo n.º 4
0
 public SkillUsage(SkillUsageType usageType, float usageValue)
 {
     UsageType  = usageType;
     UsageValue = usageValue;
 }