public void unlockFragment(string id) { if (actualFragmentSection != null) { //Debug.Log ("ho sbloccato il frammento "+id); //se è un frammento devo //1. aggiornare l'array di sprites a sinistra //2. mostrare le sprites a sinistra aggiornate //3. eseguire l'animazione dell'oggetto raccolto //4. eseguire il suono //1. updateFragmentSprites(); //2. GeneralFinder.playingUILateral.showIcons(PlayingUILateral.UIPosition.Left, true); showLeft = true; showLeftTime = Time.time; //3. PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(findContent(actualFragmentSection, id).iconUnlock, PlayingUILateral.UIPosition.Left, findContentIndex(actualFragmentSection, id)); pick.setTimeToGetSmall(timeToGetSmall); //4. if (audioHandler != null) { audioHandler.playClipByName("UnlockStar"); } } }
void UIHandler(Sprite inputSprite) { //Debug.Log ("called"); PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(inputSprite, PlayingUI.UIPosition.BottomRight, 0); pick.setTimeToGetSmall(1.5f); }
public void unlockContent(string name) { if (actualContentSection != null) { //Debug.Log ("ho sbloccato l'oggetto "+name); //se è un collezionabile devo //0. mostrare la sprite del libro, se non presente //1. aggiornare l'array di sprites a destra //2. mostrare le sprites a destra aggiornate //3. eseguire l'animazione dell'oggetto raccolto //4. mostrare l'icona del libro lampeggiante per tot secondi //4. eseguire il suono //0. if (!activeBook) { activeBook = true; setUpperRightVariables(); setUpperRightStandardBook(); setUpperRightButton(); //Debug.Log ("entrato"); } //1. updateContentSprites(); //2. GeneralFinder.playingUILateral.showIcons(PlayingUILateral.UIPosition.Right, true); showRight = true; showRightTime = Time.time; //3. PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(findContent(actualContentSection, name).iconUnlock, PlayingUILateral.UIPosition.Right, findContentIndex(actualContentSection, name)); pick.setBigScale(200.0f); pick.setTimeToGetSmall(timeToGetSmall); //pagina GameObject testGO = new GameObject(); testGO.transform.position = transform.position; PickingObjectGraphic pick02 = testGO.AddComponent <PickingObjectGraphic>(); pick02.setVariables(spritesBook.pageSprite, PlayingUI.UIPosition.UpperRight, 0); pick02.setBookPage(true); pick02.setTimeToGetSmall(pageTimeToGetSmall); startCentralButtonPulsing(); setUpperRightExclamationBook(); //setPulsingBook(); //4. if (audioHandler != null) { audioHandler.playClipByName("UnlockContent"); } } }
public void unlockFact(string name) { if (actualFactSection != null) { //Debug.Log ("ho sbloccato il fun fact "+name); //se è un fun fact devo //0. mostrare la sprite del libro, se non presente //1. eseguire l'animazione della pagina raccolta //2. mostrare l'icona del libro lampeggiante per tot secondi //3. eseguire il suono //0. if (!activeBook) { activeBook = true; setUpperRightVariables(); setUpperRightStandardBook(); setUpperRightButton(); } //1. PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(spritesBook.pageSprite, PlayingUI.UIPosition.UpperRight, 0); pick.setBookPage(true); pick.setTimeToGetSmall(pageTimeToGetSmall); //2. setUpperRightExclamationBook(); //setPulsingBook(); //3. if (audioHandler != null) { audioHandler.playClipByName("UnlockFact"); } startCentralButtonPulsing(); } }
void Update() { if (Input.GetKeyUp(KeyCode.N)) { playingUILateral.showIcons(PlayingUILateral.UIPosition.Right); } if (Input.GetKeyUp(KeyCode.M)) { playingUILateral.showIcons(PlayingUILateral.UIPosition.Right, false); } if (Input.GetKeyUp(KeyCode.V)) { playingUILateral.showIcons(PlayingUILateral.UIPosition.Left); } if (Input.GetKeyUp(KeyCode.B)) { playingUILateral.showIcons(PlayingUILateral.UIPosition.Left, false); } if (Input.GetKeyUp(KeyCode.K)) { if (left) { playingUILateral.setSprites(left02, PlayingUILateral.UIPosition.Left); } else { playingUILateral.setSprites(left01, PlayingUILateral.UIPosition.Left); } left = !left; playingUILateral.updateSpritesOnScreen(PlayingUILateral.UIPosition.Left); } if (Input.GetKeyUp(KeyCode.L)) { if (right) { playingUILateral.setSprites(right02, PlayingUILateral.UIPosition.Right); } else { playingUILateral.setSprites(right01, PlayingUILateral.UIPosition.Right); } right = !right; playingUILateral.updateSpritesOnScreen(PlayingUILateral.UIPosition.Right); } if (Input.GetKeyUp(KeyCode.J)) { playingUILateral.setExclamation(PlayingUILateral.UIPosition.Right, 2, true); playingUILateral.setExclamation(PlayingUILateral.UIPosition.Right, 3, true); } if (Input.GetKeyUp(KeyCode.H)) { playingUILateral.setExclamation(PlayingUILateral.UIPosition.Right, 2, false); } if (Input.GetKeyUp(KeyCode.G)) { playingUILateral.removeAllExclamations(); } if (Input.GetKeyUp(KeyCode.O)) { PulsingUIElement pulsing = gameObject.AddComponent <PulsingUIElement>(); pulsing.setVariables(playingUILateral.getImageObject(PlayingUILateral.UIPosition.Right, 1), 10.0f, 1.5f, 4.0f); PulsingUIElement pulsing02 = gameObject.AddComponent <PulsingUIElement>(); pulsing02.setVariables(playingUI.getImageObject(PlayingUI.UIPosition.UpperRight, 0), 10.0f, 1.5f, 4.0f); } if (Input.GetKeyUp(KeyCode.U)) { PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(glassSprite, PlayingUI.UIPosition.BottomRight, 0); } if (Input.GetKeyUp(KeyCode.Y)) { PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(glassSprite, PlayingUILateral.UIPosition.Right, 2); playingUILateral.showIconsImmediately(PlayingUILateral.UIPosition.Right, true); playingUILateral.showIconsImmediately(PlayingUILateral.UIPosition.Left, true); } if (Input.GetKeyUp(KeyCode.T)) { PickingObjectGraphic pick = gameObject.AddComponent <PickingObjectGraphic>(); pick.setVariables(glassSprite, PlayingUILateral.UIPosition.Left, 0); playingUILateral.showIconsImmediately(PlayingUILateral.UIPosition.Right, false); playingUILateral.showIconsImmediately(PlayingUILateral.UIPosition.Left, false); } }