public List <GameObject> RetrieveAllyModels() { List <GameObject> models = new List <GameObject>(); List <int> modelIds = new List <int>(); foreach (var allyId in GameData.Instance.currentPartyMemberCharacterIds) { Paradigm allyParadigm = GameData.Instance.allyEquippedSouldParadigms[allyId]; modelIds.Add(modelInformationDatabase.Find(x => x.characterId == allyId && x.paradigm == allyParadigm).modelId); } //loops through all ids for (int i = 0; i < modelIds.Count; i++) { //loops through all model info records for (int ii = 0; ii < allyDatabase.transform.childCount; ii++) { ModelId model = allyDatabase.transform.GetChild(ii).GetComponent <ModelId>(); if (checkedOutAllyModels.ContainsKey(model.GetInstanceID()) == false && model.modelId == modelIds[i]) { models.Add(model.gameObject); checkedOutAllyModels.Add(model.GetInstanceID(), new Vector2(model.transform.localPosition.x, model.transform.localPosition.y)); break; } } } return(models); }
public List <GameObject> RetrieveEnemyModels(List <int> modelIds) { List <GameObject> models = new List <GameObject>(); //loops through all ids for (int i = 0; i < modelIds.Count; i++) { //loops through all model info records for (int ii = 0; ii < enemyDatabase.transform.childCount; ii++) { ModelId model = enemyDatabase.transform.GetChild(ii).GetComponent <ModelId>(); if (checkedOutEnemyModels.ContainsKey(model.GetInstanceID()) == false && model.modelId == modelIds[i]) { models.Add(model.gameObject); checkedOutEnemyModels.Add(model.GetInstanceID(), new Vector2(model.transform.localPosition.x, model.transform.localPosition.y)); break; } } } return(models); }
public GameObject RetrievePlayerModel() { GameObject playerModel = null; int playerModelId = modelInformationDatabase.Find(x => x.characterId == PLAYER_CHARACTER_ID && x.paradigm == GameData.Instance.playerEquippedSoulParadigm).modelId; for (int ii = 0; ii < playerDatabase.transform.childCount; ii++) { ModelId model = playerDatabase.transform.GetChild(ii).GetComponent <ModelId>(); if (checkedOutPlayerModels.ContainsKey(model.GetInstanceID()) == false && model.modelId == playerModelId) { checkedOutPlayerModels.Add(model.modelId, new Vector2(model.transform.localPosition.x, model.transform.localPosition.y)); playerModel = model.gameObject; break; } } return(playerModel); }