Beispiel #1
0
        private void GiveClassSkills(int characterID, ClassDatam classDatam)
        {
            Entity characterEntity = characters[characterID];
            //Character character = World.EntityManager.GetComponentData<Character>(characterEntity);
            //CharacterDatam characterDatam = meta[character.metaID];
            Skills newSkills = World.EntityManager.GetComponentData <Skills>(characterEntity);//new Skills { };

            newSkills.Initialize(classDatam);
            World.EntityManager.SetComponentData(characterEntity, newSkills);
            skillsSystem.InitializeSkills(characterEntity, newSkills);
        }
Beispiel #2
0
 public void Initialize(ClassDatam classer)
 {
     if (classer != null)
     {
         //if (skills.Length == 0)
         {
             skills = new BlitableArray <SkillData>(classer.startingSkills.Count, Unity.Collections.Allocator.Persistent);
             for (int i = 0; i < classer.startingSkills.Count; i++)
             {
                 skills[i] = classer.startingSkills[i].Value;
             }
         }
     }
 }