void Awake() { levelz = GameObject.FindGameObjectWithTag("loading").gameObject; victory = GeneralControls.ReturnNumber(levelz, "victory"); defeated1 = GeneralControls.ReturnNumber(levelz, "defeated"); mainmenu1 = GeneralControls.ReturnNumber(victory, "mainmenu"); mainmenu2 = GeneralControls.ReturnNumber(defeated1, "mainmenu"); loadbar = GeneralControls.ReturnNumber(levelz, "loadbar"); zerodefeated = GeneralControls.ReturnNumber(levelz, "zero"); zeromainmenu = GeneralControls.ReturnNumber(zerodefeated, "mainmenu"); //intailize lamp animation lamp_color = GameObject.FindGameObjectWithTag("lamp").gameObject; trying = GameObject.FindGameObjectWithTag("tries").gameObject; randomcolor = Random.Range(0, lamp.Length - 1); currentcolor = lamp[randomcolor]; lampanime = lamp_color.GetComponent <Animator>(); currentLampColor = GeneralControls.LampColorNum(currentcolor); lampanime.SetInteger("lampcolor", currentLampColor); }
IEnumerator ResetActive3() { yield return(new WaitForSeconds(0.2f)); if (active1box != null) { GeneralControls.ResetBox(active1box); } active1box = null; active1boxchild = null; active1 = false; if (active2box != null) { GeneralControls.ResetBox(active2box); } active2box = null; active2boxchild = null; active2 = false; if (active3box != null) { GeneralControls.ResetBox(active3box); } active3box = null; active3boxchild = null; active3 = false; }
IEnumerator Lamp1() { yield return(new WaitForSeconds(.2f)); GeneralControls.BoxExplode(active1box); StartCoroutine("Lamp1Destroy"); }
void Awake() { //Check if there is already an instance of SoundManager if (instance == null) { //if not, set it to this. instance = this; } //If instance already exists: else if (instance != this) { //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager. Destroy(gameObject); } Advertisement.Initialize("1027042"); levels = GameObject.FindGameObjectWithTag("loading").gameObject; background = GameObject.FindGameObjectWithTag("backgrounds").gameObject; if (levels != null) { zerovictory = GeneralControls.ReturnNumber(levels, "victory"); zerodefeat = GeneralControls.ReturnNumber(levels, "zero"); defeat1 = GeneralControls.ReturnNumber(levels, "defeated"); } DontDestroyOnLoad(gameObject); }
IEnumerator LampDies() { yield return(new WaitForSeconds(.2f)); try{ lampanime.SetBool("dead", true); } catch (System.NullReferenceException ne) { Debug.Log(ne); } boxArray = GameObject.FindGameObjectsWithTag("boxes"); for (int i = 0; i < boxArray.Length; i++) { GeneralControls.DestroyBox(boxArray[i]); } if (PlayerPrefs.GetInt(levelcomplete) != 1) { PlayerPrefs.SetInt(levelcomplete, 1); } StartCoroutine("DestroyLamp"); }
void Awake() { loaderArray = GameObject.FindGameObjectsWithTag("loading"); levelz = GameObject.FindGameObjectWithTag("levels").gameObject; one = GeneralControls.ReturnNumber(levelz, "one"); two = GeneralControls.ReturnNumber(levelz, "two"); three = GeneralControls.ReturnNumber(levelz, "three"); four = GeneralControls.ReturnNumber(levelz, "four"); five = GeneralControls.ReturnNumber(levelz, "five"); six = GeneralControls.ReturnNumber(levelz, "six"); arrow = transform.FindChild("arrow").gameObject; arrow_right = transform.FindChild("arrow_right").gameObject; loader = transform.FindChild("loadbar").gameObject; ones = one.GetComponent <Animator>(); twos = two.GetComponent <Animator>(); threes = three.GetComponent <Animator>(); fours = four.GetComponent <Animator>(); fives = five.GetComponent <Animator>(); sixes = six.GetComponent <Animator>(); }
IEnumerator Lamp3Destroy() { StartCoroutine("resetbox3"); yield return(new WaitForSeconds(0.5f)); lamp = GeneralControls.RemoveLamp(lamp, randomcolor); temp1 = active1box; temp2 = active2box; temp3 = active3box; active1box = null; active1boxchild = null; active1 = false; active2box = null; active2boxchild = null; active2 = false; active3box = null; active3boxchild = null; active3 = false; oneTime = 0; if (lamp.Length != 0) { randomcolor = Random.Range(0, lamp.Length - 1); currentcolor = lamp[randomcolor]; currentLampColor = GeneralControls.LampColorNum(currentcolor); lampanime.SetInteger("lampcolor", currentLampColor); } }
// Update is called once per frame void Update() { if (Input.touchCount > 0) { if (Input.GetTouch(0).phase == TouchPhase.Began) { temp = GeneralControls.checkTouch(Input.GetTouch(0).position); } } if (Input.GetMouseButtonDown(0)) { temp = GeneralControls.checkTouch(Input.mousePosition); } if (temp == one) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level1story")); } if (temp == two) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level2story")); } if (temp == three) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level3story")); } if (temp == four) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level4")); } if (temp == five) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level5")); } if (temp == six) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level6")); } if (temp == arrow) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("LevelSelectorDesolateOasis")); } }
// Update is called once per frame void Update() { if (Input.touchCount > 0) { if (Input.GetTouch(0).phase == TouchPhase.Began) { temp = GeneralControls.checkTouch(Input.GetTouch(0).position); } } if (Input.GetMouseButtonDown(0)) { temp = GeneralControls.checkTouch(Input.mousePosition); } if (temp == one) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level25story")); } if (temp == two) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level26")); } if (temp == three) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level27")); } if (temp == four) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level28")); } if (temp == five) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level29")); } if (temp == arrow_right) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("LevelSelectorMysticSwamp")); } if (temp == arrow) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("LevelSelectorDarkAbyss")); } }
IEnumerator resetbox1() { yield return(new WaitForSeconds(1)); if (temp1 != null) { GeneralControls.DestroyBox(temp1); } temp1 = null; }
IEnumerator DestroyLamp() { yield return(new WaitForSeconds(1)); GeneralControls.DestroyBox(lamp_color); victory.SetActive(true); Sound.instance.victorious(); trying.SetActive(false); defeated1.SetActive(false); zerodefeated.SetActive(false); }
void ResetEverything() { levels = GameObject.FindGameObjectWithTag("loading").gameObject; if (levels != null) { zerovictory = GeneralControls.ReturnNumber(levels, "victory"); zerodefeat = GeneralControls.ReturnNumber(levels, "zero"); defeat1 = GeneralControls.ReturnNumber(levels, "defeated"); } check = false; }
internal void LoadCore(GameObjectRepo gameObjectRepo, HandlerHub handlerHub, GameMenuControls gameMenuControls, OptionMenuControls optionMenuControls, GeneralControls generalControls, Func <GameState> oldGameStateFunc, Func <GameState> newGameStateFunc) { var coreInstaller = new CoreModuleInstaller(gameObjectRepo, gameMenuControls, optionMenuControls, generalControls, oldGameStateFunc, newGameStateFunc, handlerHub); coreInstaller.Install(handlerHub); }
IEnumerator resetbox2() { yield return(new WaitForSeconds(1)); if ((temp1 != null) && (temp2 != null)) { GeneralControls.DestroyBox(temp1); GeneralControls.DestroyBox(temp2); } temp1 = null; temp2 = null; }
private void Start() { _handlerHub = new HandlerHub(); _gameObjectRepo = new GameObjectRepo(); var gameMenuControls = new GameMenuControls(); var optionMenuControls = new OptionMenuControls(); var generalControls = new GeneralControls(); _moduleModuleManager.LoadCore(_gameObjectRepo, _handlerHub, gameMenuControls, optionMenuControls, generalControls, () => _oldGameState, () => _newGameState); _moduleModuleManager.LoadModules(_handlerHub); var startUpHandler = new StartUpHandler(generalControls); startUpHandler.SpecificHandle(_oldGameState, _newGameState); }
void Awake() { loaderArray = GameObject.FindGameObjectsWithTag("loading"); levelz = GameObject.FindGameObjectWithTag("levels").gameObject; one = GeneralControls.ReturnNumber(levelz, "one"); arrow_right = transform.FindChild("arrow_right").gameObject; loader = transform.FindChild("loadbar").gameObject; ones = one.GetComponent <Animator>(); }
public CoreModuleInstaller(GameObjectRepo gameObjectRepo, GameMenuControls gameMenuControls, OptionMenuControls optionMenuControls, GeneralControls generalControls, Func <GameState> oldGameStateFunc, Func <GameState> newGameStateFunc, HandlerHub handlerHub ) : base("Core") { _gameObjectRepo = gameObjectRepo; _gameMenuControls = gameMenuControls; _optionMenuControls = optionMenuControls; _generalControls = generalControls; _oldGameStateFunc = oldGameStateFunc; _newGameStateFunc = newGameStateFunc; _handlerHub = handlerHub; }
IEnumerator zeroremains() { yield return(new WaitForSeconds(0.2f)); for (int i = 0; i < boxes.Length; i++) { if ((boxes[i] != null) && (boxes[i] != temp1) && (boxes[i] != temp2) && (boxes[i] != temp3)) { GeneralControls.DestroyBox(boxes[i]); } } zerodefeated.SetActive(true); trying.SetActive(false); Sound.instance.defeated(); lamp_color.SetActive(false); }
IEnumerator defeat() { yield return(new WaitForSeconds(0.5f)); for (int i = 0; i < boxArray.Length; i++) { if ((boxArray[i] != null) && (boxArray[i] != temp1) && (boxArray[i] != temp2) && (boxArray[i] != temp3)) { GeneralControls.DestroyBox(boxArray[i]); } } defeated1.SetActive(true); Sound.instance.defeated(); }
private void Update() { if (Input.GetKeyDown(KeyCode.N) || Input.GetMouseButtonDown(0)) { Debug.Log(GeneralControls.IsConnectedInternet() + " Internet Bağlantısı"); Debug.Log(S_IsFirebaseInitialized + " Firebase Kurulumu"); Debug.Log(S_IsDatabaseReferencesCreated + " Veritabanı Referansı"); Debug.Log(S_IsUserProfileReady + " Kullanıcı Profili"); Debug.Log(S_IsCorrectPanelSelected + " Doğru Panel"); Debug.Log(S_IsAuthControlled + " Auth Kontrolü"); } m_CheckProgressionTimer -= Time.deltaTime; if (m_CheckProgressionTimer <= 0) { if (isFirstTime) { if (GeneralControls.IsConnectedInternet() && S_IsFirebaseInitialized && S_IsDatabaseReferencesCreated && S_IsUserProfileReady) { if (S_IsCorrectPanelSelected || S_IsAuthControlled) { //delayTimer -= Time.deltaTime; //if (delayTimer <= 0) { TransitionManager.Instance.TransitionAnimation(SelfDestruction); isFirstTime = false; return; } } } m_CheckProgressionTimer = m_CheckProgressionTimerLimit; } } }
public GeneralControls() { instance = this; }
// Update is called once per frame void Update() { if (Input.touchCount > 0) { if (Input.GetTouch(0).phase == TouchPhase.Began) { temp = GeneralControls.checkTouch(Input.GetTouch(0).position); } } if (Input.GetMouseButtonDown(0)) { temp = GeneralControls.checkTouch(Input.mousePosition); } if (temp == one) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level6story")); } if (temp == two) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level8")); } if (temp == three) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level9")); } if (temp == four) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level10")); } if (temp == five) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level11")); } if (temp == six) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level12")); } if (temp == arrow_right) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("LevelSelectorLunarNight")); } if (temp == arrow) { temp = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("LevelSelectorHauntedIsle")); } }
private void OnDisable() { GeneralControls.ControlQuit(Unsubscribe); CloseResultsPanel(); }
private void OnDisable() { GeneralControls.ControlQuit(Unsubscribe); }
// Update is called once per frame void Update() { remaining.text = "Remaining Time: " + Timeremaining + "s"; if (Input.touchCount > 0) { if (Input.GetTouch(0).phase == TouchPhase.Began) { //temp box tempbox = GeneralControls.checkTouch(Input.GetTouch(0).position); } } if (Input.GetMouseButtonDown(0)) { //same as above tempbox = GeneralControls.checkTouch(Input.mousePosition); } if ((!active1) && (tempbox != null) && (!levelcheck) && (!defeated) && (tempbox != temp1) && (tempbox != temp2) && (tempbox != temp3)) { active1 = true; active1box = tempbox; tempbox = null; active1boxchild = GeneralControls.TurnOnBox(active1box, active1, false, false); count = 1; //if star and completes stage if (GeneralControls.LampOne(active1boxchild, currentcolor)) { active2 = true; active3 = true; count = 0; StartCoroutine("Lamp1"); } //checks if the box is with in the lamp colors if ((!GeneralControls.CheckBox(currentcolor, active1box)) && (count != 0) && (!GeneralControls.LampOne(active1boxchild, currentcolor))) { count = 0; StartCoroutine("ResetActive1"); } } if ((active1) && (!active2) && (tempbox != active1box) && (tempbox != null) && (!levelcheck) && (!defeated) && (tempbox != temp1) && (tempbox != temp2) && (tempbox != temp3)) { active2 = true; active2box = tempbox; tempbox = null; active2boxchild = GeneralControls.TurnOnBox(active2box, active1, active2, false); count = 2; if ((!GeneralControls.CheckBox(currentcolor, active2box)) || (GeneralControls.DuplicateBox(active1boxchild, active2boxchild)) || active2box == null) { count = 0; StartCoroutine("ResetActive2"); } } if ((active1) && (active2) && (!active3) && (tempbox != active1box) && (tempbox != active2box) && (tempbox != null) && (!levelcheck) && (!defeated) && ((GeneralControls.Lampinteger(currentcolor) == 3) || (active2boxchild.layer == 20)) && (tempbox != temp1) && (tempbox != temp2) && (tempbox != temp3)) { active3 = true; active3box = tempbox; tempbox = null; active3boxchild = GeneralControls.TurnOnBox(active3box, active1, active2, active3); count = 3; if ((!GeneralControls.CheckBox(currentcolor, active3box)) || (GeneralControls.DuplicateBox(active1boxchild, active2boxchild)) || (GeneralControls.DuplicateBox(active3boxchild, active2boxchild)) || (GeneralControls.DuplicateBox(active3boxchild, active1boxchild)) || active3box == null) { count = 0; StartCoroutine("ResetActive3"); } } if ((active1boxchild == null) && (active2boxchild != null)) { BoxArray = GameObject.FindGameObjectsWithTag("boxes"); for (int i = 0; i < BoxArray.Length; i++) { if ((BoxArray[i] != null) && (BoxArray[i] != temp1) && (BoxArray[i] != temp2) && (BoxArray[i] != temp3)) { GeneralControls.ResetBox(BoxArray[i]); } } active1box = null; active1boxchild = null; active1 = false; active2box = null; active2boxchild = null; active2 = false; count = 0; oneTime = 0; } if (((active1boxchild == null) && (active2boxchild != null) && (active3boxchild != null)) || ((active1boxchild != null) && (active2boxchild == null) && (active3boxchild != null)) || ((active1boxchild == null) && (active2boxchild == null) && (active3boxchild != null))) { BoxArray = GameObject.FindGameObjectsWithTag("boxes"); for (int i = 0; i < BoxArray.Length; i++) { if ((BoxArray[i] != null) && (BoxArray[i] != temp1) && (BoxArray[i] != temp2) && (BoxArray[i] != temp3)) { GeneralControls.ResetBox(BoxArray[i]); } } active1box = null; active1boxchild = null; active1 = false; active2box = null; active2boxchild = null; active2 = false; active3box = null; active3boxchild = null; active3 = false; count = 0; oneTime = 0; } if (count != 0) { //checks to see if lamp is complete if (GeneralControls.Finalchecklamp(currentcolor, count, active2boxchild)) { if ((count == 2) && (GeneralControls.LampTwo(active1boxchild, active2boxchild, currentcolor))) { count = 0; StartCoroutine("Lamp2"); } if ((count == 3) && (GeneralControls.LampThree(active1boxchild, active2boxchild, active3boxchild, currentcolor))) { count = 0; StartCoroutine("Lamp3"); } } } if ((lamp.Length == 0) && (levelcheck != true)) { victory1 = true; levelcheck = true; if (levelcheck) { StartCoroutine("LampDies"); } } if ((tempbox == victory) && (victory1)) { Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level11")); tempbox = null; } if ((tempbox == defeated1) && (defeated)) { Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level10")); tempbox = null; } if ((tempbox == mainmenu1) || (tempbox == mainmenu2) || (tempbox == zeromainmenu)) { tempbox = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("LevelSelectorDesolateOasis")); } if (tempbox == zerodefeated) { tempbox = null; Sound.instance.buttonclick(); StartCoroutine(loadinglevel("level10")); } if ((Timeremaining == 0) && (!defeated) && (!victory1)) { defeated = true; oneTime = 1; boxes = GameObject.FindGameObjectsWithTag("boxes"); StartCoroutine("zeroremains"); } if ((!defeated) && (!victory1) && (oneTime == 0) && (temp1 == null) && (temp2 == null) && (temp3 == null)) { oneTime = 1; boxArray = GameObject.FindGameObjectsWithTag("boxes"); if ((!GeneralControls.CheckCombination(boxArray, currentcolor))) { defeated = true; StartCoroutine("defeat"); } } }
private void OnDestroy() { GeneralControls.ControlQuit(Unsubscribe); }
private void Awake() { keyboardControls = new GeneralControls(); keyboardControls.Keyboard.DestroyBalls.performed += _ => DestroyObject(); }
private void OnApplicationQuit() { GeneralControls.ControlQuit(Unsubscribe); }
public CreateSettingsButtonInGameMenuHandler(GameMenuControls gameMenuControls, GeneralControls generalControls, HandlerHub handlerHub) { _gameMenuControls = gameMenuControls; _generalControls = generalControls; _handlerHub = handlerHub; }
private void Awake() { isDisplayed = true; keyboardControls = new GeneralControls(); }