// Use this for initialization void Start() { thePlayer = FindObjectOfType <PlayerController> (); fading = GetComponent <Fading> (); dMan = FindObjectOfType <DialogueManager> (); dHold = GetComponent <DialogueHolder> (); }
void ControlWinLoseGroupElements() { StartCoroutine(Fading.FadeUIGraphic <Text>(1f, 0f, 0.05f, t_lvlnumber)); winloseGroup.SetActive(true); StartCoroutine(Fading.FadeUIGraphic <Image>(0f, 0.6f, 0.05f, i_panel)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_winloseheader, 1f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_winlosereason, 1f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_scoreheader, 1.5f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_score, 1.5f)); StartCoroutine(Fading.FadeUIGraphic <Image>(0f, 1f, 0.1f, i_next, 3f)); b_menu.interactable = false; StartCoroutine(Fading.FadeUIGraphic <Image>(1f, 0f, 0.05f, i_menu)); if (isClassicMode) { b_restart.interactable = false; StartCoroutine(Fading.FadeUIGraphic <Image>(1f, 0f, 0.05f, i_restart)); } if (!isClassicMode) { StartCoroutine(Fading.FadeUIGraphic <Text>(1f, 0f, 0.05f, t_timer)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_timerheader, 1.5f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_winlosetimer, 1.5f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_cntdownheader, 1.8f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_winlosecntdown, 1.8f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_scoreheader, 2.1f)); StartCoroutine(Fading.FadeUIGraphic <Text>(0f, 1f, 0.1f, t_score, 2.1f)); t_winlosetimer.text = string.Format("{0:F1}", timer); } t_score.text = string.Format("{0:D}", winLoseManager.score); }
// Update is called once per frame void Update() { switch (fading) { case Fading.FADE_IN: alpha += 0.05f; colorChilds(new Color(1, 1, 1, alpha)); if (alpha >= 1) { fading = Fading.NONE; } break; case Fading.FADE_OUT: alpha -= 0.05f; colorChilds(new Color(1, 1, 1, alpha)); if (alpha <= 0) { fading = Fading.NONE; destroyChilds(); } break; case Fading.NONE: default: break; } }
public void CalculateTimeBonus() { t_timebonus.color = new Color(t_timebonus.color.r, t_timebonus.color.g, t_timebonus.color.b, 1f); switch (comboDisplays) { case 2: timeBonus = 0.5f; break; case 3: timeBonus = 1.5f; break; case 4: timeBonus = 3f; break; case 5: timeBonus = 6f; break; } if (comboDisplays > 5) { timeBonus = comboDisplays * 2f; } StopCoroutine(timerCor); timerCor = StartCoroutine(Fading.TimeCounter(timer + timeBonus, 0f, nowtime => timer = nowtime, isFinished => timeIsOut = isFinished)); t_timebonus.text = string.Format("+{0:F1} bonus", timeBonus); if (comboDisplays > 5) { t_timebonus.text += "!"; } StartCoroutine(Fading.FadeUIGraphic <Text>(1f, 0f, 0.2f, t_timebonus, 1.2f)); }
void SetInitialReferences() { if (LawContainers.Length != lawContentStrings.Length) { //Debug.LogError("There must be 1 textbox for each laws"); } for (int i = 0; i < LawContainers.Length; i++) { Transform container = LawContainers[i].transform; TMP_Text lawTitle = container.Find("LawPanel/Text (TMP)").GetComponent <TMP_Text>(); TMP_Text lawContent = container.Find("ContentPanel/Text (TMP)") .GetComponent <TMP_Text>(); lawTitleTMP.Add(lawTitle); lawContentTMP.Add(lawContent); } mainTitleTMP = transform.Find("Panel/TitlePanel/Text (TMP)") .GetComponent <TMP_Text>(); _glitchEffect = FindObjectOfType <GlitchEffect>(); _glitchEffect.enabled = false; _fader = FindObjectOfType <Fading>(); }
private void Update() { if (fading > Fading.None) { fadeElapsed = Mathf.Clamp(fadeElapsed + Time.deltaTime, 0, fadeDuration); if (fading == Fading.In) { canvasGroup.alpha = Mathf.Clamp01(fadeElapsed / fadeDuration); if (canvasGroup.alpha == 1) { closeAtTime = displayLength + Time.timeSinceLevelLoad; } } else if (fading == Fading.Out) { canvasGroup.alpha = Mathf.Clamp01(1 - (fadeElapsed / fadeDuration)); } if (fadeElapsed == fadeDuration) { fading = Fading.None; } } else if (canvasGroup.alpha == 1) { if (Time.timeSinceLevelLoad >= closeAtTime) { Hide(); } } }
public override void ApplyState(Gum.DataTypes.Variables.StateSave state) { bool matches = this.ElementSave.AllStates.Contains(state); if (matches) { var category = this.ElementSave.Categories.FirstOrDefault(item => item.States.Contains(state)); if (category == null) { if (state.Name == "Default") { this.mCurrentVariableState = VariableState.Default; } } else if (category.Name == "Fading") { if (state.Name == "Faded") { this.mCurrentFadingState = Fading.Faded; } if (state.Name == "NotFaded") { this.mCurrentFadingState = Fading.NotFaded; } } } base.ApplyState(state); }
public void OnClick_HowToPlayGroup() { curHelpState = 0; ChooseHelpGroup(); Graphic[] mainMenuItems = mainMenuGroup.GetComponentsInChildren <Graphic>(true); for (int i = 0; i < mainMenuItems.Length; i++) { StartCoroutine(Fading.FadeUIGraphic <Graphic>(1f, 0f, 0.15f, mainMenuItems[i], 0.05f * i)); } StartCoroutine(Fading.ChangeActivenessDelayed(mainMenuGroup, false, 1.5f)); Button[] mainMenuButtons = mainMenuGroup.GetComponentsInChildren <Button>(true); for (int i = 0; i < mainMenuButtons.Length; i++) { mainMenuButtons[i].interactable = false; //disable these buttons to prevent bugs } howToPlayGroup.SetActive(true); Graphic[] howToPlayItems = howToPlayGroup.GetComponentsInChildren <Graphic>(true); for (int i = 0; i < howToPlayItems.Length; i++) { StartCoroutine(Fading.FadeUIGraphic <Graphic>(0f, 1f, 0.1f, howToPlayItems[i], 1f + 0.05f * i)); } Button[] howToPlayButtons = howToPlayGroup.GetComponentsInChildren <Button>(true); StartCoroutine(Fading.ChangeInteractivityDelayed(howToPlayButtons, true, 1f + 0.05f * howToPlayItems.Length)); //enable these buttons delayed to prevent bugs }
void Start() { isBattleCanvasOpen = false; isPaused = false; menuStack = new Stack <GameObject>(); fadeController = FindObjectOfType <Fading>(); }
private Gum.DataTypes.Variables.StateSave AddToCurrentValuesWithState(Fading state) { Gum.DataTypes.Variables.StateSave newState = new Gum.DataTypes.Variables.StateSave(); switch (state) { case Fading.Faded: newState.Variables.Add(new Gum.DataTypes.Variables.VariableSave() { SetsValue = true, Name = "BlackFade.Alpha", Type = "int", Value = BlackFade.Alpha + 255 } ); break; case Fading.NotFaded: newState.Variables.Add(new Gum.DataTypes.Variables.VariableSave() { SetsValue = true, Name = "BlackFade.Alpha", Type = "int", Value = BlackFade.Alpha + 0 } ); break; } return(newState); }
void Awake() { gameController = GameObject.Find("GameController").GetComponent <GameController>(); fade = GameObject.Find("FadeCanvas").GetComponent <Fading>(); robot = GameObject.Find("Robot"); robotMovement = robot.GetComponent <RobotMovement> (); }
void Start() { _spriteRenderer = gameObject.GetComponent <SpriteRenderer> (); _fading = gameObject.GetComponent <Fading> (); _spriteRenderer.enabled = false; _blackOut.SetActive(false); }
IEnumerator waitAndRestartScene() { Fading.BeginFade(1); yield return(new WaitForSeconds(1)); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }
IEnumerator waitAndLoadScene() { Fading.BeginFade(1); yield return(new WaitForSeconds(1)); SceneManager.LoadScene("scene" + "1"); SceneManager.UnloadSceneAsync(SceneManager.GetActiveScene()); }
// -- Initialisation void Start() { // -- Set Instance mInstance = this; // -- Start Fading In StartFade(null, true); }
private void Start() { fading = GetComponent <Fading>(); if (ActualScene() == 0) { Invoke("MainMenu", delay); } }
private void FadeIn() { if (!isFading) { isFading = true; Fading.FadeIn(browser, 200); } }
// Use this for initialization void Start() { fadeScript = FindObjectOfType <Fading>(); if (fadeScript) { fadeScript.BeginFade(-1); } }
public void OnClick_MainMenuGroup() { returnToMainMenuGroup.SetActive(true); StartCoroutine(Fading.FadeUIGraphic <Graphic>(0f, 0.6f, 0.15f, returnToMainElements[0])); for (int i = 1; i < returnToMainElements.Length; i++) { StartCoroutine(Fading.FadeUIGraphic <Graphic>(0f, 1f, 0.1f, returnToMainElements[i])); } }
/// <summary> Get references </summary> protected override void GetReferences() { base.GetReferences(); if (Fading == null) { this.Fading = GetComponent <Fading>(); } this._CanvasGroup = GetComponent <CanvasGroup>(); }
/// <summary> /// Get required references /// </summary> protected override void GetReferences() { base.GetReferences(); #if SUPPORTMOVIE _Audio = GetComponent <AudioSource>(); #endif _Fading = GetComponent <Fading>(); _Fading.Alpha = 1.0f; }
private void Start() { rotationHandler = GameObject.Find("Input").GetComponent <PropRotationHandler>(); fading = GameObject.Find("fade").GetComponent <Fading>(); exitInputHandler = GameObject.Find("Input").GetComponent <ExitInputHandler>(); SetRayCastingCamera(mainCam); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
void Start() { if (IsInCorrectScene()) { leaderBoardControllerScript = GameObject.Find("LeaderboardController").GetComponent <LeaderBoardControllerScript>(); } fading = GameObject.Find("GameMaster").GetComponent <Fading> (); Invoke("DeathTesterFunc", 5f); }
public void hideInformation() { asSomethingShow = false; StoppingInnerCoroutine(); routineTitre = StartCoroutine(Fading.FadeTextToZeroAlpha(1f, titre)); routineDescription = StartCoroutine(Fading.FadeTextToZeroAlpha(1f, description)); }
public void beginFade() { if (!fadeBegun) { fadeBegun = true; Fading fade = GetComponent <Fading>(); fade.BeginFade(1); } }
void Awake() { _sceneFader = GetComponent <Fading>(); _restart = transform.GetChild(0).gameObject; _writer = GameObject.FindGameObjectWithTag("DescriptionBox").GetComponentInParent <DescriptionWriter>(); _inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <InventoryLogic>(); _player = (GameObject)RetainedObjects[RetainedObjects.Count - 1]; //always place player last _cameraLead = (GameObject)RetainedObjects[RetainedObjects.Count - 2]; // always place lead next to last }
public void OnClick_ReturnToGame() { StartCoroutine(Fading.FadeUIGraphic <Graphic>(0.6f, 0f, 0.15f, returnToMainElements[0])); for (int i = 1; i < returnToMainElements.Length; i++) { StartCoroutine(Fading.FadeUIGraphic <Graphic>(1f, 0f, 0.1f, returnToMainElements[i])); } StartCoroutine(Fading.ChangeActivenessDelayed(returnToMainMenuGroup, false, 0.5f)); }
void Awake() { showPosters = GameObject.Find("ShowPosters").GetComponent <Toggle>(); posters = GameObject.Find("Poster"); gameController = GameObject.Find("GameController").GetComponent <GameController>(); fade = GameObject.Find("FadeCanvas").GetComponent <Fading>(); robot = GameObject.Find("Robot"); robotMovement = robot.GetComponent <RobotMovement> (); }
private void Awake() { fade = GetComponent <Fading>(); if (PlayerPrefs.GetInt("Level") < nextLevel) { PlayerPrefs.SetInt("Level", nextLevel - 1); PlayerPrefs.Save(); } }
public void show(bool instant = false) { if (instant) { colorChilds (new Color (1, 1, 1, 0)); }else{ colorChilds (new Color (1, 1, 1, 0)); this.alpha = 0; this.fading = Fading.FADE_IN; } }
public void Start() { // keep this object alive DontDestroyOnLoad(gameObject); fading = FindObjectOfType <Fading>(); fading.BeginFade(Fading.FadeDirection.fadeIn); Invoke("DelayToMainMenu", 1.5f); }
public void hide(bool instant = false) { if (instant) { destroyChilds (); } else { colorChilds (new Color (1, 1, 1, 1)); this.alpha = 1; this.fading = Fading.FADE_OUT; } }
void Awake() { if (fading == null) { fading = this; fading.fadeDirection = -1; // Direction to fade: in = -1 or out = 1 DontDestroyOnLoad(fading); // Can be used in multiple scenes } else { Destroy(this); // Destroy any copies of this class } }
// Use this for initialization void Start () { fader = ui.GetComponent<Fading>(); dialog = ui.GetComponent<Dialog>(); bob = bobGO.GetComponent<Bob>(); bob.inputEnable = false; if(Model.Instance.previousScene == "ChambreNuit" || Model.Instance.previousScene == "Intro") { dialogDisplayed = false; SoundScript.playDay(); SoundScript.FadeIn(); } else { Debug.Log("From Salon"); dialogDisplayed = true; bob.inputEnable = true; bob.transform.position = new Vector3(4.4f, -0.9f, -3f); bob.transform.localScale = new Vector2(-1, 1); } }
// Update is called once per frame void Update() { switch(fading){ case Fading.FADE_IN: alpha += 0.05f; colorChilds(new Color (1, 1, 1, alpha)); if (alpha >= 1) fading = Fading.NONE; break; case Fading.FADE_OUT: alpha -= 0.05f; colorChilds (new Color (1, 1, 1, alpha)); if (alpha <= 0) { fading = Fading.NONE; destroyChilds (); } break; case Fading.NONE: default: break; } }
void Awake() { fader = transform.parent.GetComponent<Fading>(); }
public void Start() { fading = GameObject.Find("Navigator").GetComponent<Fading>(); availableSheet = new List<Sheet>(); uncorrectlyAnsweredSheet = new List<Sheet>(); correctlyAnsweredSheet = new List<Sheet>(); #if UNITY_ANDROID sheetsDirectoryPath = Application.persistentDataPath + "/../../../../SeriousGame/Fiches"; #endif #if UNITY_EDITOR sheetsDirectoryPath = Application.dataPath + "/../Fiches"; #endif //sheetsDirectoryPath = Application.persistentDataPath + "/../../../../SeriousGame/Fiches"; sheetsDirectoryPath = Path.GetFullPath(sheetsDirectoryPath); // Returns a nice formated path String, no more: "dir/../another_dir" if (!Directory.Exists(sheetsDirectoryPath)) { Directory.CreateDirectory(sheetsDirectoryPath); sheetsExists = false; return; } else { sheetsPath = Directory.GetFiles(sheetsDirectoryPath, "*.xml", SearchOption.AllDirectories); if (sheetsPath.Length == 0) { sheetsExists = false; return; } totalSheets = sheetsPath.Length; for (int i = 0; i < totalSheets; i++) { xmlSheet = XDocument.Load(sheetsPath[i]); sheetType = xmlSheet.Root.Element("type").Value.ToString(); if (sheetType == "TextReadingSheet") availableSheet.Add(new TextReadingSheet(sheetsPath[i])); else if (sheetType == "ReadingSheet") availableSheet.Add(new ReadingSheet(sheetsPath[i])); } availableSheet.Sort(); } sheetsExists = true; changeCurrentSheet(); profileSheets = null; }
void Awake() { fader = transform.parent.GetComponent<Fading>(); bob = bobGO.GetComponent<Bob>(); }
// -- Initialisation void Start() { // -- Set Instance mInstance = this; if (FadePrefab == null) { Debug.Log("FadePrefab is null"); } // -- Start Fading In StartFade(null, true); }
// Use this for initialization void Awake () { fader = ui.GetComponent<Fading>(); }
// Use this for initialization void Start () { dialog = GetComponent<Dialog>(); fading = GetComponent<Fading>(); }
private int fadeDir = -1; // The direction to fade void Start() { instance = this; }
// Use this for initialization void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); DontDestroyOnLoad(gameObject); scene = GetComponent<StorySceneManager>(); player = (StoryPlayer)FindObjectOfType(typeof(StoryPlayer)); InitCharacterDic(); fader = GameObject.Find("Navigator").GetComponent<Fading>(); PNJTable = new List<string>(); ObjectsTable = new List<string>(); PNJTable.Add("Pixie"); PNJTable.Add("Gaby"); //PNJTable.Add("Philibert"); //PNJTable.Add("Camille"); //PNJTable.Add("Victor"); //PNJTable.Add("Olivier-happy"); //ObjectsTable.Add("Lunettes"); //ObjectsTable.Add("Seve"); //ObjectsTable.Add("Secret"); InitGame(); }
void Awake() { fader = transform.parent.GetComponent<Fading>(); bob = GameObject.Find("Bob").GetComponent<Bob>(); }
// Use this for initialization void Start() { game = GetComponent<Gameplay>(); Fade = GetComponent<Fading>(); }
void setOwner(NetworkPlayer player) { Debug.Log ("Setting the owner."); owner = player; if(player == Network.player) { enabled = true; GameObject radar = gameObject.transform.FindChild("Radar").gameObject; if(radar.transform.FindChild("RadarBlackout")) { radarControl = radar.transform.FindChild("RadarBlackout").GetComponent<Fading>(); } if(Network.isClient) { GameObject serverCam = GameObject.Find("ServerCamera"); if(serverCam) { if(serverCam.GetComponent<Camera>()) { serverCam.GetComponent<Camera>().enabled = false; } if(serverCam.GetComponent<AudioListener>()) { serverCam.GetComponent<AudioListener>().enabled = false; } } } } else if(Network.isServer || player != Network.player) { GameObject radar = gameObject.transform.FindChild("Radar").gameObject; GameObject radarBlackout = radar.transform.FindChild("RadarBlackout").gameObject; if(radar.GetComponent<Camera>()) { radar.GetComponent<Camera>().enabled = false; } if(radarBlackout.GetComponent<MeshRenderer>()) { radarBlackout.GetComponent<MeshRenderer>().enabled = false; } if(gameObject.GetComponentInChildren<Camera>()) { gameObject.GetComponentInChildren<Camera>().enabled = false; } if(transform.parent.transform.FindChild("HUDElements") != null && transform.parent.transform.FindChild("NewTank") != null) { GameObject hud = transform.parent.transform.FindChild("HUDElements").gameObject; GameObject tank = transform.parent.transform.FindChild("NewTank").gameObject; if(hud.GetComponentInChildren<Camera>()) { hud.GetComponentInChildren<Camera>().enabled = false; } if(hud.GetComponentInChildren<AudioListener>()) { hud.GetComponentInChildren<AudioListener>().enabled = false; } if(hud.GetComponentInChildren<GUILayer>()) { hud.GetComponentInChildren<GUILayer>().enabled = false; } if(tank.GetComponentInChildren<Camera>()) { tank.GetComponentInChildren<Camera>().enabled = false; } if(tank.GetComponentInChildren<AudioListener>()) { tank.GetComponentInChildren<AudioListener>().enabled = false; } if(tank.GetComponentInChildren<GUILayer>()) { tank.GetComponentInChildren<GUILayer>().enabled = false; } Component[] hudTexts = hud.GetComponentsInChildren<GUIText> (); foreach (GUIText text in hudTexts) { text.enabled = false; } Component[] hudTextures = hud.GetComponentsInChildren<GUITexture> (); foreach (GUITexture texture in hudTextures) { texture.enabled = false; } } } }