void Start() { renderer = gameObject.GetComponent (typeof(MeshRenderer)) as MeshRenderer; this.anims = new List<MyAnim> (); MyAnim open = new MyAnim (renderer, 3.0f, 1.0f / 60.0f); open.Add (tex1); MyAnim eyes = new MyAnim (renderer, 2.1f, 0.9f); eyes.Add (tex2); eyes.Add (tex3); MyAnim eyes2 = new MyAnim (renderer, 2.1f, 0.9f); eyes2.Add (tex4); eyes2.Add (tex5); MyAnim shadow = new MyAnim (renderer, 3.0f, 1.0f / 60.0f); shadow.Add (tex6); MyAnim tray = new MyAnim (renderer, 3.0f, 1.0f / 60.0f); tray.Add (tex7); anims.Add (open); anims.Add (eyes); anims.Add (eyes2); anims.Add (shadow); anims.Add (tray); fade = (Fade)GameObject.Find ("Camera").GetComponent (typeof(Fade)); fade.SetState (Fade.State.FadeIn); navi = GameObject.Find ("Navi"); naviX = navi.transform.position.x; }
public ChangedStage(ContentManager content, SpriteBatch sprite) { FadeScreen = Fade.FadeIn; DrawFadeState = sprite; SoildWhite = content.Load<Texture2D>("Data\\SoildColorWhite"); SoildBlack = content.Load<Texture2D>("Data\\SoildColorBlack"); }
// start playing a track public void startTrack(String trackname, int fadeMS) { if (loadedTracks.ContainsKey(trackname)) { // set to next track nextTrack = loadedTracks[trackname]; fadelength = fadeMS; fadestartTime = DateTime.Now; // if a previous track exists, fade out if (prevTrack) { fade = Fade.OUT; } else { // otherwise start fade in fade = Fade.IN; MediaPlayer.Play(nextTrack); MediaPlayer.IsRepeating = true; nextTrack = null; prevTrack = true; } } }
public SerializableFade(Fade fade) { CurveType = fade.Curve.ToString(); ReciprocalCurve = fade.ReciprocalCurve.ToString(); LengthNanos = fade.Length.Nanos; Gain = fade.Gain; }
void Start() { GameObject a = GameObject.Find("05_GameManager"); if(a!=null)_gm = a.GetComponent<Game_Manager>(); GameObject b = GameObject.Find("Black_Screen"); if(b!=null)_fade = b.GetComponent<Fade>(); }
public MusicPlayer() { this.StartVolume = 1; this.FadeTarget = Fade.Disabled; this.FadeTimer = new System.Timers.Timer(); this.FadeTimer.Interval = 150; this.FadeTimer.Elapsed += UpdateFade; }
protected void FadeForm(Fade oFade) { if(_bFading) return; if(oFade==Fade.Up) _dTargetOpacity=1.00; if(oFade==Fade.Down) _dTargetOpacity=0.0; FadeForm(); }
// Use this for initialization void Start () { coffeeController = player.GetComponent<DrinkCoffee>(); gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>(); beginningAmount = GameController.totalTimeSpentDrinkingCoffee; fader = GameObject.FindGameObjectWithTag("Fader").GetComponent<Fade>(); initialIdleTimeToTransition += fader.FadeTime; }
void SetInstance() { if(Instance == null) { Instance = this; } else { Debug.LogError("Creation of a second fade instance was attempted. It will be destroyed."); Destroy (this); } }
private void Start() { if (Instance == null) Instance = this; fadeGroup = transform.GetChild(0).GetComponent<CanvasGroup>(); gameOverGroup = fadeGroup.transform.GetChild(1).GetComponent<CanvasGroup>(); text = gameOverGroup.transform.GetChild(0).GetComponent<Text>(); gameOverGroup.gameObject.SetActive(false); FadeIn(); }
void Start() { currentScene = Object.Instantiate (scenePrefabs[0]); metricController = GetComponent<MetricController>(); totalTimeSpentDrinkingCoffee = 0.0f; Debug.Log (currentScene.ToString ()); fader = c.GetComponent<Fade> (); IsGameOver = false; fader.FadeIn (); }
void Start () { obj_keeper = GameObject.FindGameObjectWithTag("GLOBAL_keeper"); keeper = obj_keeper.GetComponent<Keeper>(); obj_fade = GameObject.FindGameObjectWithTag("GLOBAL_fade"); fade = obj_fade.GetComponent<Fade>(); if (fade_on_start) { fade.EndFade(); } }
IEnumerator FadeAudio(float timer, Fade fadeType) { float start = fadeType == Fade.In? 0.0F : 1.0f; float end = fadeType == Fade.In? 1.0f : 0.0f; float i = 0.0f; float step = 1.0f/timer; while (i <= 1.0f) { i += step * Time.deltaTime; AudioListener.volume = Mathf.Lerp(start, end, i); yield return new WaitForSeconds(step * Time.deltaTime); } }
private IEnumerator FadeAudio(AudioSource source, float timer, Fade fadeType) { float start = fadeType == Fade.In? 0.0F : 1.0F; float end = fadeType == Fade.In? 1.0F : 0.0F; float i = 0.0F; float step = 1.0F/timer; while (i <= 1.0F) { i += step * Time.deltaTime; source.volume = Mathf.Lerp(start, end, i); yield return new WaitForSeconds(step * Time.deltaTime); } source.Stop(); }
public static IEnumerator FadeAudio(AudioSource audio, float duration, Fade fadeType, Interpolate.EaseType easeType = Interpolate.EaseType.EaseOutExpo) { float start = fadeType == Fade.In ? 0.0f : 1.0f; float distance = fadeType == Fade.In ? 1.0f : -1.0f; float t = 0.0f; var easeFunction = Interpolate.Ease(easeType); while (t <= duration) { audio.volume = easeFunction(start, distance, t, duration); t += Time.deltaTime; yield return null; } }
public void PlayMusic(EMusicType music) { if(CurrentTrack != music) { CurrentTrack = music; if(CurrentTrack == EMusicType.None) { fade = Fade.IN; MusicSource.clip = MusicList[(int)music]; MusicSource.Play(); } else fade = Fade.OUT; } }
void Awake() { if (_ins == null) { // Populate with first instance _ins = this; DontDestroyOnLoad(this); } else { // Another instance exists, destroy if (this != _ins) Destroy(this.gameObject); } }
IEnumerator FadeAudio(float timer, Fade fadeType) { float start = (fadeType == Fade.In) ? 0.0F : 0.5F; float end = (fadeType == Fade.In) ? 0.5F : 0.0F; float i = 0.0F; float step = 1.0F / timer; while (i <= 1.0F) { i += step * Time.deltaTime; GetComponent<AudioSource> ().volume = Mathf.Lerp(start, end, i); yield return new WaitForSeconds (step * Time.deltaTime); } }
public FadeActivity(Fade fade, TimeSpan duration, EaseMode easeMode, Action<object[]> onCompletion = null) : base(duration, onCompletion) { switch (fade) { case Fade.In: _from = 0.0F; _to = 1.0F; break; case Fade.Out: _from = 1.0F; _to = 0.0F; break; } _easeMode = easeMode; }
public Playlist(Playlist p) { name = p.name; enabled = p.enabled; playWhen = new Prerequisites(p.playWhen); loop = p.loop; shuffle = p.shuffle; pauseOnGamePause = p.pauseOnGamePause; disableAfterPlay = p.disableAfterPlay; playNext = p.playNext; playBefore = p.playBefore; playAfter = p.playAfter; tracks = new List<string>(p.tracks); channel = p.channel; fade = new Fade(p.fade); trackFade = new Fade(p.trackFade); preloadTime = p.preloadTime; }
IEnumerator FadeCoroutine(Fade fade) { float startAlpha = canvasGroup.alpha; float endAlpha = 0; if (fade == Fade._in) endAlpha = 1f; float duration = 0f; while(duration < fadeDuration) { duration += Time.deltaTime; canvasGroup.alpha = Mathf.Lerp(startAlpha, endAlpha, duration / fadeDuration); yield return new WaitForEndOfFrame(); } if (fade == Fade._out) canvasGroup.gameObject.SetActive(false); }
IEnumerator FadeAudio (AudioSource source, float timer, Fade fadeType) { float start = fadeType == Fade.In? 0.0F : source.volume; float end = fadeType == Fade.In? source.volume : 0.0F; float i = 0.0F; float step = 1.0F/timer; float volume = source.volume; Debug.Log ("FadeAudio " + source.gameObject.name); if (fadeType == Fade.In) { source.volume = 0f; source.Play (); } while (i <= 1.0F) { i += step * Time.deltaTime; source.volume = Mathf.Lerp(start, end, i); yield return new WaitForSeconds(step * Time.deltaTime); } if (fadeType == Fade.Out) source.Stop (); }
void Awake() { fade = GetComponentInChildren<Fade>(); fade.gameObject.SetActive(true); if (!mInstance) mInstance = this; //otherwise, if we do, kill this thing else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); settings = GetComponent<Settings>(); savedSettings = GetComponent<SavedSettings>(); clothesSettings = GetComponent<ClothesSettings>(); }
void Start() { userDataManager = UserDataManager.ins; if (userDataManager == null) { Debug.LogError("No UserDataManager found"); } modalPanel = ModalPanel.ins; yesQuitAction = new UnityAction(_QuitAndSave); noQuitAction = new UnityAction(_DoNothing); yesReloadCourseViewScene = new UnityAction(_ReloadCourseViewScene); noReloadCourseViewScene = new UnityAction(_DoNothing); fade = Fade.ins; if (fade == null) { Debug.LogError("No Fade found"); } }
//public bool intro; public void SetState(Fade.State s) { this.state = s; if (this.state == State.None) { GT.enabled = false; } else if (this.state == State.FadeOut) { GT.texture = FadeOutTexture; Color co = GT.color; co.a = 0; GT.color = co; GT.enabled = true; ended = false; } else if (this.state == State.FadeIn) { GT.texture = FadeInTexture; Color ci = GT.color; ci.a = 1; GT.color = ci; GT.enabled = true; } }
private void fade() { switch (fading) { case Fade.In: fadeIn.a -= Time.deltaTime; fader.color = fadeIn; if (fadeIn.a <= 0) { nextLine(); fading = Fade.None; } break; case Fade.Out: fadeOut.a += Time.deltaTime; fader.color = fadeIn; if (fadeOut.a >= 1) { fading = Fade.None; //TODO: go to next scene! } break; } }
public void DrawFade(GameTime time) { if (FadeBegin) { if (FadeAlpha <= 0) FadeScreen = Fade.FadeIn; if (FadeAlpha >= 255) { FadeScreen = Fade.FadeOut; CurrentStage = NextState; } if (FadeInSpeed < time.ElapsedGameTime.Milliseconds && FadeOutSpeed < time.ElapsedGameTime.Milliseconds) { FadeAlpha = -1; CurrentStage = NextState; } else { if (FadeScreen == Fade.FadeIn) { if (FadeInSpeed < time.ElapsedGameTime.Milliseconds) FadeAlpha = 256; else FadeAlpha += (255 / (FadeInSpeed / (float)time.ElapsedGameTime.Milliseconds)); } if (FadeScreen == Fade.FadeOut) { if (FadeOutSpeed < time.ElapsedGameTime.Milliseconds) FadeAlpha = -1; else FadeAlpha -= (255 / (FadeOutSpeed / (float)time.ElapsedGameTime.Milliseconds)); } } DrawFadeState.Begin(); DrawFadeState.Draw(FadeTexture, new Rectangle(0, 0, 1280, 720), Color.FromNonPremultiplied(255, 255, 255, (Byte)MathHelper.Clamp(FadeAlpha, 0, 255))); DrawFadeState.End(); if (FadeAlpha < 0) { FadeBegin = false; FadeAlpha = 0; } } }
IEnumerator FadeMusic(AudioSource audio, float timer, Fade fadeType, System.Action<bool> onComplete = null) { float start = fadeType == Fade.In ? 0.0f : musicVolume; float end = fadeType == Fade.In ? musicVolume : 0.0f; float i = 0.0f; float step = musicVolume / timer * Time.deltaTime; if (fadeType == Fade.In) audio.Play (); while (i < 1.0) { i += step; audio.volume = Mathf.Lerp (start, end, i); yield return 0; } if (fadeType == Fade.Out) audio.Stop (); if (onComplete != null) onComplete (true); yield return null; }
public void NextLevel() { StopAllCoroutines(); _currentLevel++; if (_currentLevel >= Levels.Length) { _currentLevel = -1; _currentDay++; ShowStory(1); return; } Debug.LogWarning("NextLevel: " + Levels[_currentLevel].Name + ", id: " + _currentLevel); Fade.FadeThisSit(Levels[_currentLevel].Name);//, Levels[_currentLevel].FadeTime); }
public void Init(OptionsView view, Fade fade, bool duringLevel) { m_view = view; m_fade = fade; var options = Pix.Game.GetInstance().Options; m_view.BackPressed += HandleBackPressed; m_view.SoundPressed += HandleSoundPressed; m_view.MusicPressed += HandleMusicPressed; m_view.RestorePurchasesPressed += HandleRestorePurchasesPressed; m_view.GPGSPressed += HandleGPGSPressed; m_view.SetVersion(Application.version); m_view.SetSoundEnabled(options.IsSoundEnabled()); m_view.SetMusicEnabled(options.IsMusicEnabled()); bool restorePurchaseAvailable = !duringLevel && Pix.Game.GetInstance().Purchaser.IsRestoreAvailable(); m_view.SetRestorePurchasesEnabled(restorePurchaseAvailable); UpdateSocial(); }
// Update is called once per frame void Update() { if (!isFade) { Fade.SetFade(); StartCoroutine("FadeOut"); isFade = true; } if (!isEventStart) { return; } if (pim.isSkip) { Fade.FadeIn("level-1"); } if (pd.state == PlayState.Paused) { Fade.FadeIn("level-1"); isEventStart = false; } }
private void AnimationTimer_Tick(object sender, EventArgs e) { int prevOpacity = _display.MyOpacity; lock (_animationLock) { if (_fadeAnimation != null) { _display.MyOpacity = _fadeAnimation.GetOpacity(); if (_fadeAnimation.Done()) { _animationTimer.Stop(); _fadeAnimation = null; _onAnimationStopEvent?.Invoke(); _onAnimationStopEvent = null; } } } if (prevOpacity != _display.MyOpacity) { Main.GetInstance().RequestRedraw(true); } }
async void DoWarp() { if (!ConnectsTo) { return; } ConnectsTo.Disable(); Player.Current.Disable(); if (stairsAnimation) { await StairAnimation(); } await Fade.Out_Task(1f); Player.Current.Warp(ConnectsTo.position + (Vector2Int.up * 2)); Player.Current.spriteRenderer.sortingLayerName = "Characters"; await Fade.In_Task(1f); Player.Current.Enable(); }
/// <summary> /// キーの入力待ち状態 /// </summary> private void _WaitKey() { XInputDotNetPure.GamePadState pad1 = GamePad.GetState(PlayerIndex.One); XInputDotNetPure.GamePadState pad2 = GamePad.GetState(PlayerIndex.Two); XInputDotNetPure.GamePadState pad3 = GamePad.GetState(PlayerIndex.Three); XInputDotNetPure.GamePadState pad4 = GamePad.GetState(PlayerIndex.Four); m_intervalTime += Time.deltaTime; if (Input.GetKeyDown(KeyCode.A)) { Fade.ChangeScene("Ending"); } if ((pad1.Buttons.Start == ButtonState.Pressed) || (pad2.Buttons.Start == ButtonState.Pressed) || (pad3.Buttons.Start == ButtonState.Pressed) || (pad4.Buttons.Start == ButtonState.Pressed) || (m_intervalTime >= 3.0f)) { Fade.ChangeScene("Ending"); } }
// Start is called before the first frame update void Start() { nmr_scns = SceneManager.sceneCountInBuildSettings; achievement_script = achievement.GetComponent <AchievementSystem>(); for (int i = 1; i < nmr_scns; i++) { GameObject go = (GameObject)Instantiate(button_prefab); go.transform.SetParent(this.transform, false); Button btn = go.GetComponent <Button>(); int tmp = i; btn.onClick.AddListener(() => SelectLevel(tmp)); string txt = tmp.ToString(); txt += ("\n " + "Steps: " + achievement_script.GetSteps(i)); btn.GetComponentInChildren <Text>().text = txt; } fade_script = fade_obj.GetComponent <Fade>(); fade_obj.SetActive(false); selected_level = -1; }
public IEnumerator Title() { if (isStart) { cover.SetActive(true); bug.SetActive(true); titleback.SetActive(true); Fade.FadeIn(titleback, 2); titlefront.SetActive(true); Fade.FadeIn(titlefront, 2); yield return(0); title.SetActive(true); Fade.FadeIn(title, 4); yield return(new WaitForSeconds(2)); cover.SetActive(false); isStart = false; } titleback.SetActive(true); titlefront.SetActive(true); title.SetActive(true); }
private void Start() { _textPensamento.SetActive(true); animaBoss = modelBoss.GetComponent <Animator>(); bossScript = FindObjectOfType <Boss>(); BossLife.SetActive(true); //player = GameObject.FindGameObjectWithTag("Player"); //CHAMAR TRANSIÇÃO transicaoParaODia = FindObjectOfType <TransicaoParaODia>(); if (SceneManager.GetActiveScene().name == "SalaBoss") { GetComponent <Animator>().SetBool("bSalaBoss", true); if (GetComponent <Animator>().GetInteger("countStand") == 0) { StartCoroutine(waitStand()); } GetComponent <Animator>().SetBool("bStretch", true); } else { GetComponent <Animator>().SetBool("bSalaBoss", false); } fadeScript = FindObjectOfType <Fade>(); //Scripts player movScript = FindObjectOfType <Movimentacao>(); combosScript = FindObjectOfType <Combos>(); dashScript = FindObjectOfType <dashMove>(); jumpScript = FindObjectOfType <PlayerJump>(); }
// Update is called once per frame void Update() { if (currentFade != null || fades.Count > 0) { if (currentFade == null) { currentFade = fades.Dequeue(); fadeTimeLeft = currentFade.fadeTime; } float deltaTime = Time.deltaTime; if (fadeTimeLeft > deltaTime) { fadeTimeLeft -= deltaTime; fadeImage.color = Color.Lerp(currentFade.targetColor, startColor, fadeTimeLeft / currentFade.fadeTime); fadeImage.enabled = true; } else if (fades.Count > 0) { // Debug.Log("Fade Completed"); startColor = currentFade.targetColor; fadeImage.color = startColor; fadeImage.enabled = true; currentFade = fades.Dequeue(); fadeTimeLeft = currentFade.fadeTime; } else { // Debug.Log("Fade Completed"); startColor = currentFade.targetColor; fadeImage.color = startColor; fadeImage.enabled = currentFade.targetColor.a > 0.0f; currentFade = null; fadeTimeLeft = 0.0f; } } }
// Start is called before the first frame update void Start() { playerRig = GetComponent <Rigidbody>(); //フラグ達 select = false; jumpFlag = false; //ジャンプ rayFlag = false; //レイ restratFlag = false; //トゲ revFlag = false; //スティック MaxjumpSpeed = jumpDefalut * 2; currentPlayerState = PlayerState.Normal; Scale = gameObject.transform.lossyScale; timer = starttimer; scoreNumber = 0; fade = GetComponent <Fade>(); audio = GetComponent <AudioSource>(); life = GameObject.Find("HPpanel").GetComponent <LifeGauge>(); lifeback = GameObject.Find("HPpanelBack").GetComponent <LifeGauge>(); SetAngle(); refCount = ReflectCount; life.SetLifeGauge(hp); lifeback.SetLifeGauge(hp); colPlayer = GetComponent <CapsuleCollider>(); }
public void Start() { Resources.UnloadUnusedAssets(); GetLock(); tutorialDoneFlg = PlayerPrefs.GetBool("tutorialDoneFlg"); if (tutorialDoneFlg) { string userId = PlayerPrefs.GetString("userId"); GetBanCount(userId); } fade = GameObject.Find("FadeCanvas").GetComponent <Fade>(); /*Sound Controller Start*/ if (GameObject.Find("BGMController") == null) { string bgmPath = "Prefabs/Common/SoundController/BGMController"; GameObject bgmObj = Instantiate(Resources.Load(bgmPath)) as GameObject; bgmObj.name = "BGMController"; } if (GameObject.Find("SEController") == null) { string sePath = "Prefabs/Common/SoundController/SEController"; GameObject seObj = Instantiate(Resources.Load(sePath)) as GameObject; seObj.name = "SEController"; } BGMSESwitch bgm = GetComponent <BGMSESwitch> (); bgm.StopSEVolume(); bgm.StopBGMVolume(); /*Sound Controller End*/ string versionNo = Application.version; GameObject.Find("Ver").GetComponent <Text>().text = versionNo; }
private bool SetBlinkOnLogoText(Console console, TimeSpan delta) { var fadeEffect = new Fade { AutoReverse = true, DestinationForeground = new ColorGradient(Color.Blue, Color.Yellow), FadeForeground = true, UseCellForeground = false, Repeat = true, FadeDuration = 0.7f, RemoveOnFinished = true }; var cells = new List <Cell>(); for (int index = 0; index < 10; index++) { int point = new Point(26, Height - 1).ToIndex(Width) + 14 + index; cells.Add(Cells[point]); } SetEffect(cells, fadeEffect); return(true); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Goal")) { if (!goal) { collision.gameObject.SetActive(false); goal = true; Collider2D col = GameObject.Find("Goal2").GetComponent <Collider2D>(); col.enabled = true; anim.SetBool("Over", true); present.transform.SetParent(transform); present.transform.localPosition = new Vector3(0f, 0.85f, 0); } else { Fade fade = GameObject.FindObjectOfType <Fade>(true); fade.SceneName = "Clear"; fade.gameObject.SetActive(true); } } if (collision.gameObject == In) { cling = true; rigid.gravityScale = 0; } else if (collision.gameObject == Out) { cling = false; rigid.gravityScale = 4f; } else { rigid.gravityScale = 8f; } }
private async Task DeleteMediaListItem() { var transition = new Fade(Visibility.ModeOut); transition.SetDuration(300); ExitTransition = transition; await _presenter.DeleteMediaListEntry(_mediaList.Id, () => { try { Activity.SupportFragmentManager.PopBackStack(BackstackTag, (int)PopBackStackFlags.Inclusive); DismissAllowingStateLoss(); } catch { _pendingDismiss = true; } }, () => { Snackbar.Make(_coordLayout, "Error occurred while deleting list entry", Snackbar.LengthShort) .Show(); }); }
IEnumerator FadeCoroutine(Fade fade) { float startAlpha = canvasGroup.alpha; float endAlpha = 0; if (fade == Fade._in) { endAlpha = 1f; } float duration = 0f; while (duration < fadeDuration) { duration += Time.deltaTime; canvasGroup.alpha = Mathf.Lerp(startAlpha, endAlpha, duration / fadeDuration); yield return(new WaitForEndOfFrame()); } if (fade == Fade._out) { canvasGroup.gameObject.SetActive(false); } }
void LoadLevel(string text) { FindObjectOfType <AudioManager>().PlaySound("Select", 0); Fade.FadeIn(text); }
// Start is called before the first frame update void Start() { Fade.FadeOut(); isMove = false; }
public void FadeOut() { visibleElements = transform.GetComponentsInChildren <SpriteRenderer>(); fading = Fade.FadeOut; }
void LateUpdate() { if (isHidden) { if (positionOk) { positionOffset = new Vector3(-hiddenOffset, positionOffset.y, 0); } else { if (positionOffset.x - 0.01f < -hiddenOffset) { positionOffset = new Vector3(-hiddenOffset, positionOffset.y, 0); positionOk = true; } else { positionOffset = Vector3.Lerp(positionOffset, new Vector3(-hiddenOffset, positionOffset.y, 0), Time.deltaTime * 8); } } } else { if (positionOk) { } else { if (positionOffset.x + 0.01f > 0) { positionOffset = new Vector3(0, positionOffset.y, 0); positionOk = true; } else { positionOffset = Vector3.Lerp(positionOffset, new Vector3(0, positionOffset.y, 0), Time.deltaTime * 8); } } } if (fading == Fade.FadeOut) { foreach (SpriteRenderer visible in visibleElements) { visible.color = Color.Lerp(visible.color, hiddenColor, 0.1f); if (visible.color == hiddenColor) { fading = Fade.Invisible; } } } else if (fading == Fade.FadeIn) { foreach (SpriteRenderer visible in visibleElements) { visible.color = Color.Lerp(visible.color, visibleColor, 0.1f); if (visible.color == visibleColor) { fading = Fade.Visible; } } } return; }
void Awake() { instance = this; }
void MoviePlay() { Handheld.PlayFullScreenMovie("Cutscene_Win.mp4", Color.black, FullScreenMovieControlMode.Hidden, FullScreenMovieScalingMode.Fill); Fade.LoadLevel("LevelSelect"); }
private void Awake() { fade = GetComponent <Fade>(); fastFlg = false; }
//public GameObject player; void Start() { fade = gameObject.AddComponent <Fade>(); player = GameObject.FindGameObjectWithTag("Player"); }
public int gold = 0; // Armazena de quantidade de ouro que coletamos // Start is called before the first frame update void Start() { fade = FindObjectOfType(typeof(Fade)) as Fade; fade.fadeOut(); }
public override object ToUFEEffect() { Fade eff = new Fade(); return(eff); }
private int fadeDir = -1; // the direction to fade: in = -1 or out = 1 void Awake () { FadeInstance = this; }
// Update is called once per frame void Update() { Vector3 trans; Quaternion qt = new Quaternion(0, 0, 0, 0); //回転 if (Fade.FadeEnd()) { if (Input.GetKeyDown(KeyCode.LeftArrow) && !rotation) { BGMManager.Instance.PlaySE("Character_Change"); charno--; if (nowrad == 0.0f) { nowrad = 360.0f; } if (charno < 0) { charno = charMax - 1; } if (charno >= charMax) { charno = 0; } selectrad = charno * 360.0f / charMax; rotation = true; } else if (Input.GetKeyDown(KeyCode.RightArrow) && !rotation) { BGMManager.Instance.PlaySE("Character_Change"); charno++; if (nowrad == 360.0f) { nowrad = 0; } selectrad = charno * 360.0f / charMax; if (charno < 0) { charno = charMax; } if (charno >= charMax) { charno = 0; } rotation = true; } if (nowrad < selectrad) { nowrad += rotspead; if (nowrad >= selectrad) { // nowrad = selectrad; rotation = false; } // Axis.transform.rotation = rot; } else if (nowrad > selectrad) { nowrad -= rotspead; if (nowrad <= selectrad) { //nowrad = selectrad; rotation = false; } // Axis.transform.rotation = rot; } } for (int i = 0; i < charMax; ++i) { trans.x = -1.5f * Mathf.Sin((nowrad + (i * 360.0f / charMax)) * Mathf.Deg2Rad) * 1.2f; trans.y = position[i].transform.position.y; trans.z = -1.5f * Mathf.Cos((nowrad + (i * 360.0f / charMax)) * Mathf.Deg2Rad) * 1.2f; position[i].transform.position = trans; position[i].transform.rotation = qt; position[i].transform.Rotate(new Vector3(0, 1, 0), (nowrad + (i * 360.0f / charMax))); } /* * if (Input.GetKey(KeyCode.Backspace)) * { * Application.LoadLevel("Menu"); * } * if (Input.GetKey(KeyCode.Return)) * { * Application.LoadLevel("main"); * } * */ for (int i = 0; i < soapsAnimation.Count; ++i) { if (i == charno) { soapsAnimation[i].SetBool("Select", true); } else { soapsAnimation[i].SetBool("Select", false); } } if (nowrad == selectrad) { rotation = false; } }
// Use this for initialization void Start() { m_goImage.enabled = false; m_fadeObject = GameObject.FindObjectOfType <Fade>(); }
void Start() { m_fade = FindObjectOfType <Fade>(); StartCoroutine(StartBGM()); m_fade.FadeOut(); }
//trueで終了押された public bool Select() { if (StartChecker == false) { return(false); } if (Input.GetKeyDown(KeyCode.RightArrow) && Fade.FadeEnd()) { //色制御と選択 SelectText.color = NonSelectTextColor; SelectText = hiraganaSelect.RightSelect(); NonSelectTextColor = SelectText.color; SelectText.color = SelectTextColor; type = hiraganaSelect.GetType(); //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Move"); } } if (Input.GetKeyDown(KeyCode.LeftArrow) && Fade.FadeEnd()) { //色制御と選択 SelectText.color = NonSelectTextColor; SelectText = hiraganaSelect.LeftSelect(); NonSelectTextColor = SelectText.color; SelectText.color = SelectTextColor; type = hiraganaSelect.GetType(); //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Move"); } } if (Input.GetKeyDown(KeyCode.UpArrow) && Fade.FadeEnd()) { //色制御と選択 SelectText.color = NonSelectTextColor; SelectText = hiraganaSelect.TopSelect(); NonSelectTextColor = SelectText.color; SelectText.color = SelectTextColor; type = hiraganaSelect.GetType(); //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Move"); } } if (Input.GetKeyDown(KeyCode.DownArrow) && Fade.FadeEnd()) { //色制御と選択 SelectText.color = NonSelectTextColor; SelectText = hiraganaSelect.DownSelect(); NonSelectTextColor = SelectText.color; SelectText.color = SelectTextColor; type = hiraganaSelect.GetType(); //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Move"); } } //カーソルスケール変更 Vector3 scale = cursor.transform.localScale; scale.x = hiraganaSelect.GetScaleX(); cursor.transform.localScale = scale; //カーソル位置変更 cursor.transform.position = SelectText.transform.position; //アンダーバー制御 if (textLength < 5) { InputString.text = InputString.text.Replace("_", ""); anderBarTimeCount += Time.deltaTime; if (anderBarTimeCount < ANDER_BAR_TIME * 0.5f) { InputString.text = InputString.text + "_"; } if (anderBarTimeCount > ANDER_BAR_TIME) { anderBarTimeCount = 0.0f; } } //戻るキー押された if (Input.GetKeyDown(KeyCode.Escape)) { //テキスト一文字削除 if (textLength > 0) { InputString.text = InputString.text.Replace("_", ""); InputString.text = InputString.text.Remove(textLength - 1); textLength--; //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Cancel"); } } } //決定キー押された if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Joystick1Button0)) { switch (type) { case ResultHiraganaData.EHiraganaType.TYPE_TEXT: if (InputString != null && textLength < 5) { InputString.text = InputString.text.Replace("_", ""); InputString.text = InputString.text + SelectText.text; textLength++; //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Decision"); } } break; case ResultHiraganaData.EHiraganaType.TYPE_BACKSPACE: //テキスト一文字削除 if (textLength > 0) { InputString.text = InputString.text.Replace("_", ""); InputString.text = InputString.text.Remove(textLength - 1); textLength--; //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Cancel"); } } break; case ResultHiraganaData.EHiraganaType.TYPE_END: //テキスト入力終了(1文字以上ある場合) if (textLength > 0) { InputString.text = InputString.text.Replace("_", ""); SaveName(); //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Decision"); } return(true); } else { //SE if (BGMManager.Instance != null) { BGMManager.Instance.PlaySE("Cursor_Cancel"); } } break; } } return(false); }