internal void CreateRelicPopup(AttackRelic relic, Relic_Type relic_type) { GameObject popup = Instantiate(relic_popup, this.transform); popup.transform.GetChild(0).GetComponentInChildren <Text>().text = relic.relic_name; popup.transform.GetChild(2).GetComponent <Text>().text = relic.description; foreach (char letter in relic.attack_name) { GameObject new_button; if (letter == 'x') { new_button = Instantiate(button_images[0], popup.transform.GetChild(1)); } else if (letter == 'y') { new_button = Instantiate(button_images[1], popup.transform.GetChild(1)); } } //popup.GetComponent<RectTransform>().localPosition = Vector3.zero; popup_queue.Enqueue(popup); //popup.transform.GetChild(2).GetComponent<Button>().onClick.AddListener(OnPopUpClose); CheckPopups(); }
public static int CreateRelics(string table) { int responseCode; string jsonGetData = string.Empty; // ######################################################################################### // Create the Attack Relic BaseRelic AtkRelic = new AttackRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + AtkRelic.PartitionKey + "',RowKey='" + AtkRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(AtkRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### // ######################################################################################### // Create the Health Relic BaseRelic HPRelic = new HealthRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + HPRelic.PartitionKey + "',RowKey='" + HPRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(HPRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### // ######################################################################################### // Create the Speed Relic BaseRelic SPRelic = new SpeedRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + SPRelic.PartitionKey + "',RowKey='" + SPRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(SPRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### // ######################################################################################### // Create the Accuracy Relic BaseRelic AccRelic = new AccuracyRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + AccRelic.PartitionKey + "',RowKey='" + AccRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(AccRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### return(responseCode); }