public void SetCurrentCase(int caseNumber) { if (caseNumber != CurrentCase) { // currentCaseButtonUnpressed CaseButtons[CurrentCase].GetComponent <CaseButton>().SetButtonDefault(); CurrentCase = Mathf.Clamp(caseNumber, 0, numberOfCases); CaseFlash.Instance.HideFlash(); if (numberOfCases > 1) { CaseFlash.Instance.ShowNewCaseFlash(CurrentCase); } } // currentCaseButtonPressed CaseButtons[CurrentCase].GetComponent <CaseButton>().SetButtonActive(); // Call every implemented event foreach (var ev in UISingleton.FindInterfaces <IPMCaseSwitched>()) { ev.OnPMCaseSwitched(CurrentCase); } }
private IEnumerator ShowAnswerBubble(int lineNumber, string answer, bool correct) { compilerHasBeenStopped = false; UISingleton.instance.answerBubble.ShowMessage(lineNumber); UISingleton.instance.answerBubble.SetAnswerMessage("Svar: " + answer); yield return(new WaitForSeconds(3 * (1 - PMWrapper.speedMultiplier))); if (compilerHasBeenStopped) { AbortCase(); yield break; } if (correct) { // Call every implemented event foreach (var ev in UISingleton.FindInterfaces <IPMCorrectAnswer>()) { ev.OnPMCorrectAnswer(answer); } } else { UISingleton.instance.levelHandler.currentLevel.caseHandler.CaseFailed(); // Call every implemented event foreach (var ev in UISingleton.FindInterfaces <IPMWrongAnswer>()) { ev.OnPMWrongAnswer(answer); } } }
void Start() { uISingleton = UISingleton.Instance; // Find All UI Objects levelPanel = uISingleton.GetComponentInChildren <LevelPanel>(); UpdateUI(); }
void Awake() { if (instance != null) { Destroy(this.gameObject); return; } instance = this; IntializeUI(); }
void Awake() { if (Get_Instance()) { DestroyImmediate(this.gameObject); return; } uiinstance = this; }
void Start() { uISingleton = UISingleton.Instance; sanityUI = uISingleton.GetComponentInChildren <SanityUI>(); maxEssence = 5; activeSoul = Soul.gravity; inactiveSoul = Soul.poison; this.gravityEssence = this.maxEssence; this.poisonEssence = this.maxEssence; }
private void Awake() { // if the singleton hasn't been initialized yet if (instance != null && instance != this) { Destroy(this.gameObject); } instance = this; DontDestroyOnLoad(this.gameObject); gameOverLabel.enabled = false; }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(gameObject); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } //initial setup; DontDestroyOnLoad(gameObject); }
void Start() { player = PlayerSingleton.Instance.player; playerRelic = player.relics; relics = playerRelic.relics; SetStartingItems(); uISingleton = UISingleton.Instance; itemTooltip = uISingleton.GetComponentInChildren <ItemTooltip>(); this.OnPointerEnterEvent += ShowTooltip; this.OnPointerExitEvent += HideTooltip; }
public void LoadLevel(int level) { PMWrapper.StopCompiler(); // TODO Save mainCode to database UISingleton.instance.saveData.ClearPreAndMainCode(); currentLevel.levelSetting.UseSettings(); // Call every implemented event foreach (var ev in UISingleton.FindInterfaces <IPMLevelChanged>()) { ev.OnPMLevelChanged(); } }
protected override void Start() { // Find All UI Objects uISingleton = UISingleton.Instance; soulPanel = uISingleton.GetComponentInChildren <SoulPanel>(); recapUI = uISingleton.GetComponentInChildren <RecapUI>(); relicUI = uISingleton.GetComponentInChildren <RelicUI>(); itemTooltip = uISingleton.GetComponentInChildren <ItemTooltip>(); // itemSaveManager = FindObjectOfType<ItemSaveManager>(); TODO: Save System // Set UI soulPanel.SetTexts(this.souls); soulPanel.UpdateTextsValues(); // TODO setting base values here is going to cause confusion map = new Room(new Vector2(0, 0), true, true, true, true); // default path }
void Start() { MGR = new ManagerSingleton(); UI = new UISingleton(); List <Dictionary <string, object> > data = CSVReaderScript.Read("potion_table"); if (itemblock_parents) { for (var i = 0; i < data.Count; i++) { if (data[i]["Name"] != null) { input_temp = Instantiate(itemblock_prefeb, itemblock_parents.transform); input_temp.transform.GetChild(1).GetComponent <Text>().text = data[i]["Name"].ToString() + "\n 가치 :" + data[i]["Value"].ToString(); input_temp.transform.GetChild(2).GetComponent <Text>().text = "종류: " + data[i]["Kind"].ToString() + "\n" + "회복량: " + data[i]["Increase"].ToString(); if (data[i]["Kind"].ToString() == "HP") { input_temp.transform.GetChild(0).GetComponent <Image>().sprite = HPIMAGE; kind = 3; value = int.Parse(data[i]["Value"].ToString()); increase = float.Parse(data[i]["Increase"].ToString()); desc = data[i]["Description"].ToString(); Item temp = new Item(HPIMAGE, true, kind, "HP포션", value, increase, 0, 0, 1, desc); ItemList.Add(temp); } else if (data[i]["Kind"].ToString() == "MP") { input_temp.transform.GetChild(0).GetComponent <Image>().sprite = MPIMAGE; kind = 4; value = int.Parse(data[i]["Value"].ToString()); increase = float.Parse(data[i]["Increase"].ToString()); desc = data[i]["Description"].ToString(); Item temp = new Item(HPIMAGE, true, kind, "MP포션", value, increase, 0, 0, 1, desc); ItemList.Add(temp); } } } } }
// Start is called before the first frame update void Start() { MGR = new ManagerSingleton(); FC = new FollowCamera(); UI = new UISingleton(); bb = UI.Get_Instance().transform.GetChild(3).gameObject; ReturnOldScene d_s = new GameManagerScript().Get_OldScene; ReturnOldPosition d_p = new PlayerManagerScripts().Get_OldPosition; if (d_s() != null) { if (d_s() != null) { if (d_s() != SceneManager.GetActiveScene().ToString() || d_s() != null) { this.transform.position = d_p(); } } } Vector3 angles = this.transform.eulerAngles; Rotate = this.transform.forward.x; Anim = this.GetComponent <Animator>(); if (Target_Frame != null) { Target_Frame.SetActive(false); } MoveFlag = false; if (this.gameObject.transform.name == "Pirate") // 나중에 다른 캐릭터 추가되면 리소스로드로 Sprite 바꾸는거 추가... 19.08.15 { } }
void Start() { uISingleton = UISingleton.Instance; uISingleton.setHealth(health); }
// Start is called before the first frame update void Start() { uISingleton = UISingleton.Instance; uISingleton.setBullets(bulletsInMagazine.ToString()); uISingleton.setMagazines(magazines.ToString()); }
void Awake() { mUIInstance = this; }