//notifications that fill the whole screen and pause the game public void ShowSplash(SplashData data) { splashes.Add(data); if (splashes.Count == 1) { DisplaySplash(true); menuOpenSound.Play(); SetAnim(splashAnim, true); //only play animation the first time } }
public void Add(ref Vector3 _pos) { if (mFreeSplashData.Count == 0) { return; } SplashData data = mFreeSplashData.Pop(); data.Pos = _pos; data.Time = mCurTime; data.Rotate = Random.Range(0, PI_2); mSplashData.Enqueue(data); mRefresh = true; }
void about_Click(object sender, EventArgs e) { var info = Rodent.DeviceInfo; var data = new SplashData() { Developer = info.Developer, Plugin = info.Name, Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(), Website = "www.analogwindow.com" }; var splash = new Splash(SplashBitmap, data); splash.Left = Width / 2 - splash.Width / 2; splash.Top = TopH + (Height - TopH) / 2 - splash.Height / 2; Controls.Add(splash); splash.BringToFront(); }
IEnumerator LoadNextImage() { #if UNITY_STANDALONE ++ImageToLoad; if (Splashes.Count <= ImageToLoad) { yield return(null); } else { string url = "file://" + Application.streamingAssetsPath + "/" + Splashes[ImageToLoad].Path; WWW www = new WWW(url); yield return(www); SplashData sData = Splashes[ImageToLoad]; sData.ASprite = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(www.texture.width / 2, www.texture.height / 2)); Splashes[ImageToLoad] = sData; if (ImageToLoad == 0) { ShowFirstImage(); } StartCoroutine("LoadNextImage"); } #else ++ImageToLoad; if (Splashes.Count <= ImageToLoad) { yield return(null); } else { string url = Splashes[ImageToLoad].Path; Sprite sprite = Resources.Load <Sprite>("Art/splash/" + url); SplashData sData = Splashes[ImageToLoad]; sData.ASprite = sprite; Splashes[ImageToLoad] = sData; if (ImageToLoad == 0) { ShowFirstImage(); } StartCoroutine("LoadNextImage"); } #endif }
public void Framemove() { mCurTime = Time.realtimeSinceStartup; while (mSplashData.Count != 0) { SplashData data = mSplashData.Peek(); if (1f <= mCurTime - data.Time) { mFreeSplashData.Push(mSplashData.Dequeue()); mRefresh = true; } else { break; } } CreateMesh(); SettingMaterial(); }