public SerializeableStats GetSerializeableClone() { SerializeableStats myClone = new SerializeableStats(); myClone.stats = stats.ToArray(); myClone.states = states.ToArray(); myClone.regens = regens.ToArray(); myClone.attributes = attributes.ToArray(); myClone.levels = levels.ToArray(); return(myClone); }
public SerializableDialogueTree GetSerializeableClone() { SerializableDialogueTree clone = new SerializableDialogueTree(); clone.id = id; clone.branches = new DialogueBranch.SerializeableDialogueBranch[branches.Length]; var normalBranches = branches.ToArray(); for (int i = 0; i < branches.Length; i++) { clone.branches[i] = normalBranches[i].GetSerializeableClone(); } return(clone); }
public string GetJson() { SerializeableSkills myClone = new SerializeableSkills(); myClone.skills = skills.ToArray(); return(UnityEngine.JsonUtility.ToJson(myClone)); }
public SerializeableItem GetSerializeableClone() { var clone = new SerializeableItem(); clone.id = id; clone.offset = offset; clone.maleSlot = maleSlot; var femaleSlotsArray = femaleSlots.ToArray(); clone.femaleSlots = new EquipSlot[femaleSlots.Length]; for (int i = 0; i < femaleSlotsArray.Length; i++) { clone.femaleSlots[i] = femaleSlotsArray[i]; } var femaleOffsetsArray = femaleOffsets.ToArray(); clone.femaleOffsets = new int3[femaleOffsetsArray.Length]; for (int i = 0; i < femaleOffsetsArray.Length; i++) { clone.femaleOffsets[i] = femaleOffsetsArray[i]; } var femaleModifiersArray = femaleModifiers.ToArray(); clone.femaleModifiers = new byte[femaleModifiersArray.Length]; for (int i = 0; i < femaleModifiersArray.Length; i++) { clone.femaleModifiers[i] = femaleModifiersArray[i]; } return(clone); }
public string GetJson() { SerializeableQuestLog myClone = new SerializeableQuestLog(); myClone.quests = quests.ToArray(); return(UnityEngine.JsonUtility.ToJson(myClone)); }
public byte updated; // if need update this ui // how many for objectives it has //public int targetID; //public int completed; public int GetCompleted() { int completed = 0; foreach (QuestBlock block in blocks.ToArray()) { completed += block.completed; } return(completed); }
public void AddPlayerCharacter(int characterID) { int[] previousPlayers = spawnedPlayerIDs.ToArray(); if (spawnedPlayerIDs.Length > 0) { spawnedPlayerIDs.Dispose(); } spawnedPlayerIDs = new BlitableArray <int>(previousPlayers.Length + 1, Unity.Collections.Allocator.Persistent); for (int i = 0; i < previousPlayers.Length; i++) { spawnedPlayerIDs[i] = previousPlayers[i]; } spawnedPlayerIDs[spawnedPlayerIDs.Length - 1] = characterID; }
public void Initialize(List <Entity> entities, List <float3> positions, List <Entity> newParents) { // should find closest in certain directions // if nothing in that direction dont add that direction // create navigation based no positions // top left is start of navigation List <NavigateUIElement> newNavigationElements = new List <NavigateUIElement>(); if (positions.Count == 1) { NavigateUIElement element = new NavigateUIElement(); //element.previousPosition = positions[0]; element.targetPosition = positions[0]; element.direction = 0; element.ui = newParents[0]; //element.arrayIndex = 0; element.entity = entities[0]; newNavigationElements.Add(element); } else { for (int i = 0; i < positions.Count; i++) { // up newNavigationElements = AddNavigationUI(entities, newParents, newNavigationElements, positions, positions[i], i, 2, 10000); // down newNavigationElements = AddNavigationUI(entities, newParents, newNavigationElements, positions, positions[i], i, 3, -10000); // left newNavigationElements = AddNavigationUI(entities, newParents, newNavigationElements, positions, positions[i], i, 1, -10000); // right newNavigationElements = AddNavigationUI(entities, newParents, newNavigationElements, positions, positions[i], i, 0, 10000); } } NavigateUIElement[] originalNavigationElements = navigationElements.ToArray(); navigationElements = new BlitableArray <NavigateUIElement>(originalNavigationElements.Length + newNavigationElements.Count, Unity.Collections.Allocator.Persistent); for (int i = 0; i < originalNavigationElements.Length; i++) { navigationElements[i] = originalNavigationElements[i]; } for (int i = 0; i < newNavigationElements.Count; i++) { navigationElements[i + originalNavigationElements.Length] = newNavigationElements[i]; } //UnityEngine.Debug.LogError("Initialized " + navigationElements.Length + " with navigateUIElement."); }
public void DestroyLetters(EntityManager entityManager) { if (letters.Length > 0) { Entity[] entities = letters.ToArray(); foreach (Entity e in entities) { if (entityManager.Exists(e)) { entityManager.DestroyEntity(e); } } letters.Dispose(); } }
public void AddNewBodyPart(int bodyPartIndex, int slotIndex, Item item) { var oldBodyParts = body.ToArray(); body = new BlitableArray <EquipmentItem>(oldBodyParts.Length + 1, Allocator.Persistent); for (int i = 0; i < oldBodyParts.Length; i++) { body[i] = oldBodyParts[i]; } var bodyPart = new EquipmentItem(); bodyPart.data = item; bodyPart.bodyIndex = bodyPartIndex; bodyPart.slotIndex = slotIndex; body[oldBodyParts.Length] = bodyPart; dirty = 1; }
public void DestroyEntity(EntityManager EntityManager, int index) { DestroChildAtIndex(EntityManager, index); var children_ = children.ToArray(); children = new BlitableArray <Entity>(children.Length - 1, Allocator.Persistent); for (int i = 0; i < children.Length; i++) { if (i < index) { children[i] = children_[i]; } else { children[i] = children_[i + 1]; } } }