/// <summary> /// 选中一个称号 /// </summary> /// <param name="_itemUI"></param> void OnSelectSkillUI(TitleUI _itemUI) { selectTitleUI = _itemUI; if (OnSelectItemEvent != null) { OnSelectItemEvent(selectTitleUI); } }
protected override void ReleaseSelf(bool calledDestroy) { if (SystemConfig.IsReleaseResourceOn) { TitleUI.Instance = null; base.ReleaseSelf(true); } }
public SceneTitle(Game game) : base(game) { Menu = new TitleUI(this); FloorBatch = new PrimitiveBatch <VertexPositionNormalTexture>(GraphicsDevice); MorphoPositionBase = new LerpVector2(new Vector2(650, Viewport.Height + 160)); MorphoHeight = new LerpFloat(40); GroundVelocityBase = new LerpVector2(new Vector2(2, 6) * 0.2f); CastleHeight = new LerpFloat(0); var fade = new ScreenFade(this, () => ColorMatrix.Tint(Color.Black), 1, true); TitleSM.AddState(TitleState.FadeIn, new TitleStateMachine.Transfer(TitleState.SpeedUp), (state, content, input) => new TitleStateMachine.Data(60)); TitleSM.AddState(TitleState.SpeedUp, new TitleStateMachine.Transfer(TitleState.MorphoAppear), (state, content, input) => new TitleStateMachine.Data(60)); TitleSM.AddState(TitleState.MorphoAppear, new TitleStateMachine.Transfer(TitleState.CastleAppear), (state, content, input) => new TitleStateMachine.Data(60)); TitleSM.AddState(TitleState.CastleAppear, new TitleStateMachine.Transfer(TitleState.TextSlash), (state, content, input) => new TitleStateMachine.Data(320)); TitleSM.AddState(TitleState.TextSlash, new TitleStateMachine.Transfer(TitleState.TextArrange), (state, content, input) => new TitleStateMachine.Data(40)); TitleSM.AddState(TitleState.TextArrange, new TitleStateMachine.Transfer(TitleState.Finish), (state, content, input) => new TitleStateMachine.Data(40)); TitleSM.AddState(TitleState.Finish, new TitleStateMachine.Finish(), (state, content, input) => new TitleStateMachine.Data(0)); TitleSM.AddOnLeave(TitleState.FadeIn, (input) => { fade.Lerp.Set(0, LerpHelper.QuadraticOut, 60); }); TitleSM.AddOnEnter(TitleState.SpeedUp, (input) => { GroundVelocityBase.Set(new Vector2(2, 6) * 1.5f, LerpHelper.QuadraticIn, 90); }); TitleSM.AddOnEnter(TitleState.MorphoAppear, (input) => { MorphoPositionBase.Set(new Vector2(550, 550), LerpHelper.QuadraticOut, 60); MorphoHeight.Set(80, LerpHelper.QuadraticOut, 60); CastleHeight.Set(400, LerpHelper.QuadraticOut, 400); }); TitleSM.AddOnEnter(TitleState.TextSlash, (input) => { int textX = Viewport.Width / 2; int textY = Viewport.Height / 10 + 40; MorphoFlash.AddFlash(ColorMatrix.Flat(Color.White), 10); TextFlash.AddFlash(ColorMatrix.Flat(Color.Red), 10); Particles.Add(new Particle(new SlashEffect(this, 300, 15) { Angle = Random.NextFloat(MathHelper.PiOver2 - 0.1f, MathHelper.PiOver2 + 0.1f), }, new Vector2(textX, textY))); new ScreenShakeRandom(this, 10, 10, LerpHelper.QuadraticOut); }); TitleSM.AddOnLeave(TitleState.TextArrange, (input) => { TextFlash.AddFlash(ColorMatrix.Flat(Color.White), 10); new ScreenShakeRandom(this, 10, 20, LerpHelper.QuadraticOut); }); TitleSM.Start(TitleState.FadeIn); ProtoEffects.Update(); }
void Awake() { m_Inst = this; m_objUI = this.gameObject; m_objQuitUI = transform.Find("Quit").gameObject; m_objLogo = transform.Find("Logo").gameObject; m_imgBackground = transform.Find("Background").GetComponent <Image> (); m_imgTitle = transform.Find("Title").GetComponent <Image> (); m_imgLogo = m_objLogo.GetComponent <Image> (); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Car.LoadContent(Content); ScoreUI.LoadContent(Content); GameOverUI.LoadContent(Content); FPSUI.LoadContent(Content); CountdownUI.LoadContent(Content); TitleUI.LoadContent(Content); //TODO: probably should load ALL content here. Some content (e.g. sign models) still loaded at runtime }
public Binder(Game game) : base(game) { titleScene = new(game); titleUI = new(game) { PauseGame = false }; level01UI = new(game); level01Scene = new(game); Game.Components.Add(this); Game.Components.Add(titleScene); Game.Components.Add(titleUI); Game.Components.Add(level01Scene); Game.Components.Add(level01UI); }
/// <summary> /// 刷新表现 /// </summary> public void RefreshItems() { Object titleprefab = null; if (titleprefab == null) { titleprefab = exResources.GetResource(ResourceType.GUI, "Player_information/Title_Item"); } if (titleprefab == null) { GameSys.LogError("找不到预制:Player_information/Title_Item"); return; } for (int i = 0; i < titleList.Count; i++) { if (!TitleContainers.ContainsKey(i)) { GameObject obj = Instantiate(titleprefab) as GameObject; Transform parentTransf = this.gameObject.transform; obj.GetComponent <UIDragScrollView> ().scrollView = this.gameObject.GetComponentInParent <UIScrollView> (); obj.transform.parent = parentTransf; obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; TitleUI titleUI = obj.GetComponent <TitleUI>(); titleUI.FillInfo(titleList[i]); titleUI.OnSelectEvent += OnSelectSkillUI; TitleContainers[i] = titleUI; // if (firstRun && skillList[i].SkillLv>0) // { // firstRun = false; // selectSkillUI = skillUI; // UIToggle tog = obj.GetComponent<UIToggle>(); // tog.value = true; // if (OnSelectItemEvent != null) // { // OnSelectItemEvent(selectSkillUI); // } // } } else { TitleContainers[i].FillInfo(titleList[i]); } } titleprefab = null; if (grid != null) { grid.Reposition(); } }
// Use this for initialization void Start() { m_titlestate = TitleState.Start; m_girl = GameObject.Find("girl").GetComponent <TitleGirl>(); m_ribbon = GameObject.Find("ribbon_circle").GetComponent <TitleRibbon>(); m_titlelogo = GameObject.Find("TitleLogo").GetComponent <TitleLogo>(); m_titleui = GameObject.Find("TitleUI").GetComponent <TitleUI>(); // m_invisibleribbon = GameObject.Find("ribbon2/obj1").GetComponent<InvisibleRibbon>(); m_fadeCanvas.gameObject.SetActive(true); bgm000_startFlag = false; se001_startFlag = false; se017_startFlag = false; //QualitySettings.vSyncCount = 0; //Application.targetFrameRate = 60; }
protected override void Initialize() { base.Initialize(); Graphics = GraphicsDevice; //Initialize physics tainicom.Aether.Physics2D.Settings.MaxPolygonVertices = 16; world = new World(Vector2.Zero); debugView = new DebugView(world); debugView.AppendFlags(DebugViewFlags.DebugPanel | DebugViewFlags.PolygonPoints); debugView.LoadContent(GraphicsDevice, Content); //Create player player = new Player(Content, CarType.SPORT, world, adjustedSpeed); player.DodgeCompleteCallback = DodgeCompleted; player.CoinGetCallback = CoinGet; //Create objects environment = new EnvironmentManager(Content, world); trafficManager = new TrafficManager(Content, world); //Setup graphics Lighting.Initialize(); effect = Content.Load <Effect>("effect"); postProcessor = new PostProcessor(spriteBatch, Content.Load <Effect>("desaturate")); //Setup GUI scoreUI = new ScoreUI(); gameOverUI = new GameOverUI(); fpsUI = new FPSUI(); countdownUI = new CountdownUI(); titleUI = new TitleUI(); //Setup input InputManager.Initialize(); }
public SceneTitle(Game game) : base(game) { Menu = new TitleUI(this); }
private void Awake() { TitleUI.Instance = this; base.AwakeBase(BindingContext.BindingContextMode.MonoBinding, false); this.TitlesList = base.FindTransform("TitlesList").GetComponent <ListView2>(); }
void Awake() { titleUI = GetComponentInChildren <TitleUI>(); }