internal void LanguageAdd() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); //Explicit wait to click Add new element GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//a[@data-tab='first']")); //Click Language tab ClickLang.Click(); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[contains(text(),'Add New')][1]")); //Click Add new Addnewlang.Click(); //Add Language AddLang.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language")); //Add Level SelectLevel.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Level")); //Save Language SaveLang.Click(); }
public void genTextString(SelectLevel select_level, int action_cost) { switch(select_level) { case SelectLevel.Scavenge: if(action_cost == -999) display_text = node_data.node_level.ToString() + " " + node_data.node_type.ToString(); else display_text = node_data.node_level.ToString() + " " + node_data.node_type.ToString() + "\nScavenge Parts\n-" + action_cost + " AP"; break; case SelectLevel.Attack: display_text = "Attack Enemy\n-" + action_cost + " AP"; break; case SelectLevel.Travel: if(!node_occupier) { display_text = hex_data.hex_type.ToString() + "\n" + "-" + action_cost + " AP"; } else { display_text = hex_data.hex_type.ToString() + "\n" + node_data.node_level.ToString() + " " + node_data.node_type.ToString() + "\n-" + action_cost + " AP"; } break; case SelectLevel.Disabled: display_text = ""; break; } }
IEnumerator StartLoad() { for (int i = 0; i < ButtonList.GetLength(0); i++) { Button btn = ButtonList[i]; if (BtnCounter < MAXLEVEL) { BtnCounter++; SelectLevel slv = btn.GetComponent <SelectLevel>(); slv.SetLevel(BtnCounter); btn.gameObject.SetActive(true); } else { btn.gameObject.SetActive(false); } } LoadCounter++; if (BtnCounter < MAXLEVEL) { //yield return null; } else { LevelSelectController.FinishedSetup = true; LevelSelectController.needPlayFadeIn = true; } yield return(new WaitForSeconds(0.1f)); }
private GameObject CreateLevelButton(Map mapTarget) { Transform listTransform = list.transform; GameObject btnPreFab = chooseLevelBtnPreFab; if (mapTarget.name == DataController.NEW_GAME_KEY) { btnPreFab = newLevelBtnPreFab; } GameObject newBtn = Instantiate(btnPreFab); newBtn.name = mapTarget.name; newBtn.transform.SetParent(listTransform); newBtn.transform.localScale = new Vector3(1, 1, 1); SelectLevel select_level = newBtn.GetComponent <SelectLevel>(); select_level.mapTarget = mapTarget; select_level.selectLevelController = this; select_level.DefineButtonStatus(); return(newBtn); }
private void Awake() { if (ins) { Destroy(gameObject); } else { ins = this; } int i = 0; if (titles != null) { foreach (string t in titles) { var btn = Instantiate(chapterPrefab, node.transform).GetComponent <ChapterButton>(); btn.buttonTitle = t; btn.statusItem = ChapterButton.StatusItem.NONE; btn.backgroundImage = tilepages[i]; btn.buttonDescription = desc[i]; int j = i; btn.GetComponent <Button>().onClick.AddListener(delegate { preselectedSongName = songNames[j]; preenterDialog = Instantiate(Resources.Load <GameObject>("PreEnter"), GameObject.Find("Canvas").transform); //SceneManager.LoadScene(1); }); ++i; } } DontDestroyOnLoad(this); }
void Awake() { if (sel == null) { sel = this; DontDestroyOnLoad(gameObject); } }
public void levelSelectStarter() { SelectLevel s = new SelectLevel(); if (s.getLevelnumber() == 1) { SceneManager.LoadScene(1); } else { } }
private void Awake() { if (instance == null) { instance = this; } if (instance != this) { Destroy(gameObject); } }
protected Field(ICollection<Field> fields, FieldType type, string name, LocalText caption, int size, FieldFlags flags) { this.name = name; expression = "T0." + SqlSyntax.AutoBracket(name); this.size = size; this.flags = flags; this.type = type; index = -1; minSelectLevel = SelectLevel.Default; naturalOrder = 0; this.caption = caption; if (fields != null) fields.Add(this); }
void Start() { var levels = JsonUtility.FromJson <Levels>(levelsList.text).levels; foreach (var level in levels) { var button = Instantiate(levelButton, transform); Text text = button.GetComponentInChildren <Text>(); text.text = $"{level.number}"; SelectLevel selectLevel = button.GetComponentInChildren <SelectLevel>(); selectLevel.levelNumber = level.number; selectLevel.levelSeed = level.seed; selectLevel.levelLength = level.length; } }
protected Field(ICollection <Field> fields, FieldType type, string name, LocalText caption, int size, FieldFlags flags) { this.name = name; expression = "T0." + name; this.size = size; this.flags = flags; this.type = type; index = -1; minSelectLevel = SelectLevel.Default; naturalOrder = 0; this.caption = caption; if (fields != null) { fields.Add(this); } }
// Use this for initialization void Start() { completelv = PlayerPrefs.GetInt("CompleteLv"); sellv = (SelectLevel)FindObjectOfType(typeof(SelectLevel)); sav = (SaveData)FindObjectOfType(typeof(SaveData)); PrefabList = Resources.LoadAll <GameObject>("MonsterPrefab"); respawn = respawnpoint.GetComponentsInChildren <Transform>(); for (int x = 0; x < sav.selectmonster.Length; x++) { if (sav.selectmonster[x] != null) { int num = int.Parse(sav.selectmonster[x]) - 1; GameObject go = GameObject.Instantiate(PrefabList[num], respawn[x + 1].position, respawn[x + 1].rotation); go.transform.SetParent(Friend); } } }
// Use this for initialization void Start() { sellv = (SelectLevel)FindObjectOfType(typeof(SelectLevel)); money = sellv.money; //設置關卡初始金額 dat = (MonsterDatatxt)FindObjectOfType(typeof(MonsterDatatxt)); pictures = Resources.LoadAll <Sprite>("Mymonster"); img = DragPanel.GetComponentsInChildren <Image>(); Droptablearray = DropPanel.GetComponentsInChildren <Image>(); for (int x = 1; x < 7; x++) { img[x].sprite = pictures[x - 1]; } Remainmoney.text = "餘額:" + money.ToString(); Abilitytxt.text = dat.nametxt2[0] + "\n" + dat.abilitxt2[0] + "\n花費:" + dat.cost2[0]; }
protected Field(ICollection <Field> fields, FieldType type, string name, LocalText caption, int size, FieldFlags flags) { this.name = name; expression = "T0." + SqlSyntax.AutoBracket(name); this.size = size; this.flags = flags; this.type = type; index = -1; minSelectLevel = SelectLevel.Auto; naturalOrder = 0; this.caption = caption; customAttributes = Array.Empty <object>(); if (fields != null) { fields.Add(this); } }
// Update is called once per frame void Update() { if (updateLevels) { updateLevels = false; CountScenes(); //delete go + clean list foreach (GameObject go in levels) { DestroyImmediate(go); } levels.Clear(); for (int i = 0; i < numScenes; i++) { GameObject go = new GameObject(); go.name = "level" + (i + 1); SpriteRenderer sr = go.AddComponent <SpriteRenderer>(); sr.sprite = LevelSprites[i]; go.AddComponent <BoxCollider2D>(); SelectLevel sl = go.AddComponent <SelectLevel>(); sl.lockSprite = Stars[6]; GameObject score = new GameObject(); score.transform.SetParent(go.transform); score.transform.position = new Vector3(0, -4.5f, 0); score.name = "level" + (i + 1) + "score"; score.AddComponent <SpriteRenderer>(); SetScoreSprite(score, go.name); go.transform.position = new Vector3(i * distance, 0, 0); levels.Add(go); } } }
internal void LanguageEdit() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); //Click Language tab GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//a[@data-tab='first']")); ClickLang.Click(); EditLang.Click(); //Add new Language AddLang.Clear(); AddLang.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Language")); //Add new Level SelectLevel.Click(); SelectLevel.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Level")); //Click update UpdateLang.Click(); GlobalDefinitions.wait(40); }
public MinSelectLevelAttribute(SelectLevel value) { this.Value = value; }
// public bool levelCilck; // Start is called before the first frame update void Start() { //levelCilck = false; image = GetComponent <Image>(); instance = this; }
private static void UpdateNames(UnityEditor.MenuCommand command) { SelectLevel context = (SelectLevel)command.context; context.scenes = ReadNames(); }
void Awake() { instance = this; buttons = GetComponentsInChildren <Button> (); EnableButtons(); }
// Use this for initialization void Start() { sel = (SelectLevel)FindObjectOfType(typeof(SelectLevel)); }