Exemple #1
0
        public static MoveSaveData Save(Move move)
        {
            var data = new MoveSaveData();

            data.AbilityPath = move.Ability ? move.Ability.Path : "";
            move.Save(data);
            return(data);
        }
Exemple #2
0
        public static Move Create(Creature creature, MoveSaveData data)
        {
            var ability = Resources.Load <Ability>(data.AbilityPath);

            if (ability != null)
            {
                var move = ability.CreateMove(creature);
                move.Load(data);
                return(move);
            }

            return(null);
        }
Exemple #3
0
 protected virtual void Save(MoveSaveData data)
 {
     data.Name = Name;
     Traits.SaveTo(data.Traits, VariableDefinition.Saved);
 }
Exemple #4
0
 protected virtual void Load(MoveSaveData data)
 {
     Name = data.Name;
     Traits.LoadFrom(data.Traits, VariableDefinition.Saved);
 }