// Start is called before the first frame update void Start() { this.Games = new Dictionary <string, string>(); GameObject camera = GameObject.Find("Main Camera"); SliderMenu script = camera.GetComponent <SliderMenu>(); Slides = script.Slides = new List <GameObject>(); Cursor.visible = false; LoadGames(); }
private void ShowTemporaryShipBase() { if (TemporaryShipBase == null) { GameObject prefab = (GameObject)Resources.Load(Selection.ThisShip.ShipBase.TemporaryPrefabPath, typeof(GameObject)); TemporaryShipBase = MonoBehaviour.Instantiate(prefab, GetCurrentBarrelRollHelperTemplateFinisherBasePositionGO().transform.position, GetCurrentBarrelRollHelperTemplateFinisherBasePositionGO().transform.rotation, BoardManager.GetBoard()); TemporaryShipBase.transform.Find("ShipBase").Find("ShipStandInsert").Find("ShipStandInsertImage").Find("default").GetComponent <Renderer>().material = Selection.ThisShip.Model.transform.Find("RotationHelper").Find("RotationHelper2").Find("ShipAllParts").Find("ShipBase").Find("ShipStandInsert").Find("ShipStandInsertImage").Find("default").GetComponent <Renderer>().material; TemporaryShipBase.transform.Find("ShipBase").Find("ObstaclesStayDetector").gameObject.AddComponent <ObstaclesStayDetectorForced>(); obstaclesStayDetectorBase = TemporaryShipBase.GetComponentInChildren <ObstaclesStayDetectorForced>(); if (useModileControls) { ProcessTemporaryShipBaseSlider(SliderMenu.GetSliderValue()); } } }
private void PerfromTemplatePlanning() { ShowBarrelRollTemplate(); if (!useModileControls) { StartReposition(); } else { SliderMenu.ShowSlider( -0.75f * Selection.ThisShip.ShipBase.SHIPSTAND_SIZE, -0.25f * Selection.ThisShip.ShipBase.SHIPSTAND_SIZE, -0.5f * Selection.ThisShip.ShipBase.SHIPSTAND_SIZE, ProcessTemplatePositionSlider ); } }
public override void NextButton() { if (TemporaryShipBase == null) { SliderMenu.CloseSlider(); SliderMenu.ShowSlider( 0.5f * 1.18f * TheShip.ShipBase.SHIPSTAND_SIZE, 1.5F * 1.18f * TheShip.ShipBase.SHIPSTAND_SIZE, 1.0F * 1.18f * TheShip.ShipBase.SHIPSTAND_SIZE, ProcessTemporaryShipBaseSlider ); } else { SliderMenu.CloseSlider(); } ConfirmPosition(); }
public void PerfromTemplatePlanningFirstEdition() { useMobileControls = Application.isMobilePlatform; ShowBarrelRollTemplate(); if (!useMobileControls) { StartReposition(); } else { SliderMenu.ShowSlider( -0.75f * TheShip.ShipBase.SHIPSTAND_SIZE, -0.25f * TheShip.ShipBase.SHIPSTAND_SIZE, -0.5f * TheShip.ShipBase.SHIPSTAND_SIZE, ProcessTemplatePositionSlider ); } }
// Use this for initialization void Start() { SliderMenu sliderMenu = FindObjectOfType <SliderMenu>(); levels = map.GetAllLevels(); foreach (LevelNode level in levels) { GameObject go = Instantiate(SlidePrefab, SlidesContainer.transform); go.GetComponentInChildren <Text>().text = level.Caption; go.GetComponentInChildren <Button>().onClick.AddListener(() => { SetLevel(level); }); RectTransform r = go.GetComponent <RectTransform>(); Vector3 rpos = r.position; rpos.x = X; X += slideWidth + slidePadding; r.position = rpos; slides.Add(go); } sliderMenu.Init(slides); }
public void PerfromTemplatePlanning() { templateWidth = (TheShip.ShipBaseSize == Ship.BaseSize.Small) ? TheShip.ShipBase.HALF_OF_SHIPSTAND_SIZE : TheShip.ShipBase.HALF_OF_SHIPSTAND_SIZE / 2; useMobileControls = Application.isMobilePlatform; ShowBarrelRollTemplate(); if (!useMobileControls) { StartReposition(); } else { SliderMenu.ShowSlider( -0.75f * TheShip.ShipBase.SHIPSTAND_SIZE, -0.25f * TheShip.ShipBase.SHIPSTAND_SIZE, -0.5f * TheShip.ShipBase.SHIPSTAND_SIZE, ProcessTemplatePositionSlider ); } }
/// <summary> /// This is a javascript application. /// </summary> /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param> public Application(IApp page) { bool isVisible = false; var fontAwsome = new TTF.fontawesome_webfont(); var dashboard = new MenuButton(); dashboard.ButtonText.innerText = "Dashboard"; dashboard.MenuButton.css.hover.style.backgroundColor = "#97829a"; dashboard.ButtonText.css.before.style.fontFamily = fontAwsome; dashboard.ButtonText.css.before.contentText = "\xf009"; dashboard.ButtonText.css.before.style.paddingRight = "5px"; var games = new MenuButton(); games.ButtonText.innerText = "games"; games.MenuButton.css.hover.style.backgroundColor = "#97829a"; games.ButtonText.css.before.style.fontFamily = fontAwsome; games.ButtonText.css.before.contentText = "\xf11b"; games.ButtonText.css.before.style.paddingRight = "5px"; var menu = new SliderMenu(); menu.MenuHeader.innerText = "Abstractatech"; menu.SliderMenu.style.fontFamily = new TTF.OpenSans_Semibold(); dashboard.AttachTo(menu.SliderMenu); games.AttachTo(menu.SliderMenu); menu.AttachTo(page.MenuHolder); page.Click.onclick += delegate { if (!isVisible) { isVisible = true; page.MenuHolder.style.width = "15em"; menu.SliderMenu.style.width = "15em"; } else { isVisible = false; page.MenuHolder.style.width = "0em"; menu.SliderMenu.style.width = "0em"; } }; #region Styles new IStyle(menu.SliderMenu) { transition = "width 0.5s ease-in-out", Opacity = 1, width = "0em" }; new IStyle(page.MenuHolder) { transition = "width 0.5s ease-in-out", Opacity = 1, width = "0em" }; page.Click.style.fontFamily = fontAwsome; page.Click.innerText = "\xf00b"; new IStyle(page.Click) { border = "0", color = "#fff", fontSize = "2em", padding = "10px 10px 7px 10px", backgroundColor = "#97829a" }; #endregion }
/// <summary> /// This is a javascript application. /// </summary> /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param> public Application(IApp page) { bool isVisible = false; var fontAwsome = new TTF.fontawesome_webfont(); var dashboard = new MenuButton(); dashboard.ButtonText.innerText = "Dashboard"; dashboard.MenuButton.css.hover.style.backgroundColor = "#97829a"; dashboard.ButtonText.css.before.style.fontFamily = fontAwsome; dashboard.ButtonText.css.before.contentText = "\xf009"; dashboard.ButtonText.css.before.style.paddingRight = "5px"; var games = new MenuButton(); games.ButtonText.innerText = "games"; games.MenuButton.css.hover.style.backgroundColor = "#97829a"; games.ButtonText.css.before.style.fontFamily = fontAwsome; games.ButtonText.css.before.contentText = "\xf11b"; games.ButtonText.css.before.style.paddingRight = "5px"; var menu = new SliderMenu(); menu.MenuHeader.innerText = "Abstractatech"; menu.SliderMenu.style.fontFamily = new TTF.OpenSans_Semibold(); dashboard.AttachTo(menu.SliderMenu); games.AttachTo(menu.SliderMenu); menu.AttachTo(page.MenuHolder); page.Click.onclick += delegate { if (!isVisible) { isVisible = true; page.MenuHolder.style.width = "15em"; menu.SliderMenu.style.width = "15em"; } else { isVisible = false; page.MenuHolder.style.width = "0em"; menu.SliderMenu.style.width = "0em"; } }; #region Styles new IStyle(menu.SliderMenu) { transition = "width 0.5s ease-in-out", Opacity = 1, width = "0em" }; new IStyle(page.MenuHolder) { transition = "width 0.5s ease-in-out", Opacity = 1, width = "0em" }; page.Click.style.fontFamily = fontAwsome; page.Click.innerText = "\xf00b"; new IStyle(page.Click) { border = "0", color="#fff", fontSize = "2em", padding = "10px 10px 7px 10px", backgroundColor = "#97829a" }; #endregion }
public override void OnInspectorGUI() { serializedObject.Update(); SliderMenu MySliderMenu = (SliderMenu)target; //----------------------------------------------------------------------------------------------------------- //Canvas Settings GUI.backgroundColor = Color.cyan; EditorGUILayout.HelpBox("Canvas Settings", MessageType.Info); GUI.backgroundColor = Color.white; GUI.enabled = false; MySliderMenu.YourCanvas = EditorGUILayout.ObjectField("Canvas (Pro)", MySliderMenu.YourCanvas, typeof(Canvas), true) as Canvas; MySliderMenu.SlidesInView = EditorGUILayout.IntField("Slides In View (Pro)", MySliderMenu.SlidesInView); GUI.enabled = true; //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //ScrollBar Settings GUI.backgroundColor = Color.cyan; EditorGUILayout.HelpBox("ScrollBar Settings", MessageType.Info); GUI.backgroundColor = Color.white; MySliderMenu.Enable_Show_ScrollBar = EditorGUILayout.Toggle("Show ScrollBar", MySliderMenu.Enable_Show_ScrollBar); EditorGUILayout.PropertyField(serializedObject.FindProperty("HorizontalScrollBar"), true); GUI.enabled = false; MySliderMenu.ShowButtons = EditorGUILayout.Toggle("Show Buttons (Pro)", MySliderMenu.ShowButtons); if (MySliderMenu.ShowButtons == true) { MySliderMenu.ButtonSprite = EditorGUILayout.ObjectField("Button Sprite", MySliderMenu.ButtonSprite, typeof(Sprite), true) as Sprite; } GUI.enabled = true; //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //Content Settings GUI.backgroundColor = Color.cyan; EditorGUILayout.HelpBox("Content Settings", MessageType.Info); GUI.backgroundColor = Color.white; MySliderMenu.Background = EditorGUILayout.ObjectField("Background", MySliderMenu.Background, typeof(Sprite), true) as Sprite; EditorGUILayout.PropertyField(serializedObject.FindProperty("ScrollContent"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("LevelThumbnails"), new GUIContent("Slides (Manual Selection In Free Version)"), true); //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //Slides Info Settings GUI.backgroundColor = Color.cyan; EditorGUILayout.HelpBox("Slides Settings", MessageType.Info); GUI.backgroundColor = Color.white; GUI.enabled = false; MySliderMenu.SlidesNamePrefix = EditorGUILayout.TextField("Prefix Name (Pro)", MySliderMenu.SlidesNamePrefix); GUI.enabled = true; MySliderMenu.Element_Width = EditorGUILayout.FloatField("Element Width", MySliderMenu.Element_Width); MySliderMenu.Element_Height = EditorGUILayout.FloatField("Element Height", MySliderMenu.Element_Height); MySliderMenu.Element_Margin = EditorGUILayout.FloatField("Margin", MySliderMenu.Element_Margin); MySliderMenu.Element_Scale = EditorGUILayout.FloatField("Scale", MySliderMenu.Element_Scale); //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //Transition Settings GUI.backgroundColor = Color.cyan; EditorGUILayout.HelpBox("Transition Settings", MessageType.Info); GUI.backgroundColor = Color.white; GUI.enabled = false; MySliderMenu.Transition_In = EditorGUILayout.FloatField("Transition In (Pro)", MySliderMenu.Transition_In); MySliderMenu.Transition_Out = EditorGUILayout.FloatField("Transition Out (Pro)", MySliderMenu.Transition_Out); EditorGUILayout.PropertyField(serializedObject.FindProperty("PreviousSlideColor"), new GUIContent("Previous Slide Color (Pro)"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("ActiveSlideColor"), new GUIContent("Active Slide Color (Pro)"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("NextSlideColor"), new GUIContent("Next Slide Color (Pro)"), true); GUI.enabled = true; //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //Desktop Platform Enable Or Disable GUI.backgroundColor = Color.cyan; EditorGUILayout.HelpBox("Platform Settings", MessageType.Info); GUI.backgroundColor = Color.white; MySliderMenu.DesktopPlatform = EditorGUILayout.Toggle("Desktop Platform", MySliderMenu.DesktopPlatform); //----------------------------------------------------------------------------------------------------------- serializedObject.ApplyModifiedProperties(); }