private void SelectButton(dfButton control, string gameMode) { //foreach (var button in mainButtons) { // button.BackgroundSprite = button.BackgroundSprite.Replace("Highlight", String.Empty); //} //control.BackgroundSprite = control.BackgroundSprite + "Highlight"; foreach (var button in mainButtons) { button.GetComponents <dfTweenVector3>().Single(t => t.TweenName == "TweenSelect").EndValue = new Vector3(-470, button.Position.y); } control.GetComponents <dfTweenVector3>().Single(t => t.TweenName == "TweenSelect").EndValue = new Vector3(-400, control.Position.y); foreach (var button in mainButtons) { button.GetComponents <dfTweenVector3>().Single(t => t.TweenName == "TweenSelect").Play(); } currentlySelectedMode = control; if (gameMode != "TutorialMode") { leaderboard.OnModeSelected(gameMode); } }
private void SelectMode(dfButton control, string gameMode) { control.IsInteractive = false; var dfTween = control.GetComponents <dfTweenVector3>().Single(t => t.TweenName == "TweenIn"); var endValue = dfTween.EndValue; dfTween.EndValue = dfTween.StartValue; dfTween.StartValue = endValue; dfTween.Play(); CameraFade.StartAlphaFade(Color.white, false, 1.8f, 0f, () => { GlobalData.Instance.GameMode = gameMode; if (gameMode != "PeriodicMode") { Application.LoadLevel("GameScene"); } else { Application.LoadLevel("LoadingScene"); } }); }