void Awake() { instance=this; UI.colorH=new Color(1f, .6f, 0f, 1f); UI.colorN=new Color(1f, .85f, .75f, 1f); uiPerk=gameObject.GetComponent<UIPerkMenu>(); uiUnit=gameObject.GetComponent<UISetupUnit>(); }
void Awake() { instance = this; UI.colorH = new Color(1f, .6f, 0f, 1f); UI.colorN = new Color(1f, .85f, .75f, 1f); uiPerk = gameObject.GetComponent <UIPerkMenu>(); uiUnit = gameObject.GetComponent <UISetupUnit>(); }
/// <summary> /// Sets the UI with the current language /// </summary> public void SetTranslatedUI() { UISetup ui = DataStore.uiLanguage.uiSetup; settingsHeader.text = ui.settingsHeading; chooseMissionBtn.text = ui.chooseMission; viewCardBtn.text = ui.viewCardBtn; missionInfoBtn.text = ui.missionInfoBtn; threatLevel.text = ui.threatLevelHeading; addtlThreat.text = ui.addtlThreatHeading; deploymentHeader.text = ui.deploymentHeading; opdepBtn.text = ui.no; difficultyBtn.text = ui.difficulty; imperialsHeader.text = ui.imperials; mercenariesHeader.text = ui.mercenaries; adaptiveHeader.text = ui.adaptive; groupsHeading.text = ui.groupsHeading; initialBtn.text = ui.choose; reservedBtn.text = ui.choose; villainsBtn.text = ui.choose; ignoredBtn.text = ui.choose; initialHeading.text = ui.initialHeading; reservedHeading.text = ui.reservedHeading; villainsHeading.text = ui.villainsHeading; ignoredHeading.text = ui.ignoredHeading; addHeroBtn.text = ui.addHero; addAllyBtn.text = ui.addAlly; threatCostHeading.text = ui.threatCostHeading; threatCostBtn.text = ui.no; cancelBtn.text = ui.cancel; continueBtn.text = ui.continueBtn; adaptiveInfo.text = ui.adaptiveInfoUC; enemyChooserHeading.text = ui.enemyChooser; missionChooserHeading.text = ui.missionChooser; enemyBackBtn.text = ui.back; missionBackBtn.text = ui.back; heroAllyBackBtn.text = ui.back; zoomBackBtn.text = ui.back; enemyZoomBtn.text = ui.zoom; chooseHeroesHeading.text = ui.chooseHeroesHeading; heroBackBtn.text = ui.back; UIExpansions uie = DataStore.uiLanguage.uiExpansions; coreHeading.text = uie.core; twinHeading.text = uie.twin; hothHeading.text = uie.hoth; bespinHeading.text = uie.bespin; jabbaHeading.text = uie.jabba; empireHeading.text = uie.empire; lothalHeading.text = uie.lothal; otherHeading.text = uie.other; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { #region Default values at Create project //if (env.IsDevelopment()) //{ // app.UseDeveloperExceptionPage(); //} //app.UseRouting(); //app.UseEndpoints(endpoints => //{ // endpoints.MapGet("/", async context => // { // await context.Response.WriteAsync("Hello World!"); // }); //}); #endregion LogManager.LoadConfiguration(string.Concat(Directory.GetCurrentDirectory(), "/nlog.config")); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCors("CorsPolicy"); app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.All }); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); app.UseSwagger(); app.UseSwaggerUI(UISetup => { #if DEBUG // For Debug in Kestrel UISetup.SwaggerEndpoint("/swagger/v1/swagger.json", "Admin"); UISetup.SwaggerEndpoint("/swagger/v2/swagger.json", "Mobile"); #else // To deploy on IIS UISetup.SwaggerEndpoint("/StoreCoupon/swagger/v1/swagger.json", "Admin"); UISetup.SwaggerEndpoint("/StoreCoupon/swagger/v2/swagger.json", "Mobile"); #endif }); }
public override void StartWithTarget(Transform inTarget) { base.StartWithTarget(inTarget); if (inTarget.GetComponent <CanvasRenderer>() != null) { UIMode = UISetup.canvasRenderer; canvasRenderer = inTarget.GetComponent <CanvasRenderer>(); startAlpha = canvasRenderer.GetAlpha(); } else if (inTarget.GetComponent <CanvasGroup>() != null) { UIMode = UISetup.canvasGroup; canvasGroup = inTarget.GetComponent <CanvasGroup>(); startAlpha = canvasGroup.alpha; } else { Debug.LogError("This object doesn't have CanvasRenderer or CanvasGroup"); } }
void Awake() { Instance = this; }
void Awake() { uiSetup=(UISetup)target; InitLabel(); }
public override void OnInspectorGUI() { uiSetup = (UISetup)target; //DrawDefaultInspector(); EditorGUILayout.Space(); int loadMode=(int)uiSetup.loadMode; cont=new GUIContent("Data Load Mode:", "Data loading mode to be used in this scene"); contL=new GUIContent[loadModeLabel.Length]; for(int i=0; i<contL.Length; i++) contL[i]=new GUIContent(loadModeLabel[i], loadModeTooltip[i]); loadMode = EditorGUILayout.IntPopup(cont, loadMode, contL, intVal); uiSetup.loadMode=(_LoadMode)loadMode; EditorGUILayout.Space(); if(uiSetup.loadMode!=_LoadMode.UsePersistantData){ cont=new GUIContent("Starting Point:", "points available for the player to purchase unit and perk"); uiSetup.startingPlayerPoint=EditorGUILayout.IntField(cont, uiSetup.startingPlayerPoint); } EditorGUILayout.Space(); cont=new GUIContent("Main Menu:", "the name of the main menu scene"); uiSetup.mainMenu=EditorGUILayout.TextField(cont, uiSetup.mainMenu); EditorGUILayout.Space(); cont=new GUIContent("Random Next Scene:", "Check to randomise which scene to load next"); uiSetup.randomNextScene=EditorGUILayout.Toggle(cont, uiSetup.randomNextScene); if(!uiSetup.randomNextScene){ cont=new GUIContent("Next Scene:", "the name of next scene to be load"); uiSetup.nextScene=EditorGUILayout.TextField(cont, uiSetup.nextScene); } else{ int count=uiSetup.nextScenes.Count; cont=new GUIContent("Next Scenes Count:", "the number of potential next scenes to be load"); count=EditorGUILayout.IntField(cont, count); if(count!=uiSetup.nextScenes.Count){ if(uiSetup.nextScenes.Count<count){ for(int i=uiSetup.nextScenes.Count; i<count; i++){ uiSetup.nextScenes.Add(""); } } else{ List<string> newList=new List<string>(); for(int i=0; i<count; i++){ newList.Add(uiSetup.nextScenes[i]); } uiSetup.nextScenes=newList; } } for(int i=0; i<uiSetup.nextScenes.Count; i++){ uiSetup.nextScenes[i]=EditorGUILayout.TextField(" - ", uiSetup.nextScenes[i]); } } if(GUI.changed){ EditorUtility.SetDirty(uiSetup); } }
public void DrawUnitMenu() { GUIStyle style = new GUIStyle(); style.fontSize = 20; style.fontStyle = FontStyle.Bold; style.normal.textColor = UI.colorH; style.alignment = TextAnchor.UpperCenter; int winWidth = 385; int winHeight = 550; int startX = Screen.width / 2 - 30; int startY = Screen.height / 2 - winHeight / 2; int rowLimit = 5; int row = 0; int column = 0; for (int i = 0; i < 3; i++) { GUI.Box(new Rect(startX, startY, winWidth, winHeight), ""); } GUI.Label(new Rect(startX, startY + 10, winWidth, winHeight), "Unit Selection", style); style.fontSize = 16; style.alignment = TextAnchor.UpperLeft; GUI.Label(new Rect(startX + 10, startY + 45, winWidth, winHeight), "Available Units:", style); startX += 10; startY += 65; int scrollLength = (int)(Mathf.Ceil(availableUnits.Count / rowLimit + 1) * 70); if (availableUnits.Count % rowLimit == 0) { scrollLength -= 70; } Rect viewRect = new Rect(startX, startY, winWidth - 20, 280); Rect scrollRect = new Rect(startX, startY, winWidth - 50, scrollLength); GUI.Box(viewRect, ""); scrollPosition1 = GUI.BeginScrollView(viewRect, scrollPosition1, scrollRect); startX += 5; startY += 5; for (int i = 0; i < availableUnits.Count; i++) { if (tab == _Tab.Available && selectedID == i) { if (GUI.Button(new Rect(startX + column * 70 - 3, startY + row * 70 - 3, 66, 66), availableUnits[i].icon)) { } } else { if (GUI.Button(new Rect(startX + column * 70, startY + row * 70, 60, 60), availableUnits[i].icon)) { tab = _Tab.Available; selectedID = i; } } column += 1; if (column == 5) { row += 1; column = 0; } } GUI.EndScrollView(); startY += 280; if (tab == _Tab.Available) { if (GUI.Button(new Rect(startX + 280, startY, 80, 30), "Select", UI.buttonStyle)) { UnitTB unit = availableUnits[selectedID]; if (UISetup.playerPoint >= unit.pointCost) { UISetup.UpdatePoints(-unit.pointCost); selectedUnits.Add(unit); } } } else if (tab == _Tab.Selected) { if (GUI.Button(new Rect(startX + 280, startY, 80, 30), "Remove", UI.buttonStyle)) { UISetup.UpdatePoints(selectedUnits[selectedID].pointCost); selectedUnits.RemoveAt(selectedID); if (selectedUnits.Count > 0) { selectedID = Mathf.Max(selectedID - 1, 0); } else { selectedID = 0; tab = _Tab.Available; } } } style.fontSize = 16; GUI.Label(new Rect(startX, startY + 15, winWidth, winHeight), "Selected Units:", style); startX -= 5; startY += 35; scrollLength = (int)(Mathf.Ceil(selectedUnits.Count / rowLimit + 1) * 70); if (selectedUnits.Count % rowLimit == 0) { scrollLength -= 70; } viewRect = new Rect(startX, startY, winWidth - 20, 140); scrollRect = new Rect(startX, startY, winWidth - 50, scrollLength); GUI.Box(viewRect, ""); scrollPosition2 = GUI.BeginScrollView(viewRect, scrollPosition2, scrollRect); row = 0; column = 0; startX += 5; startY += 5; for (int i = 0; i < selectedUnits.Count; i++) { if (tab == _Tab.Selected && selectedID == i) { if (GUI.Button(new Rect(startX + column * 70 - 3, startY + row * 70 - 3, 66, 66), selectedUnits[i].icon)) { } } else { if (GUI.Button(new Rect(startX + column * 70, startY + row * 70, 60, 60), selectedUnits[i].icon)) { tab = _Tab.Selected; selectedID = i; } } column += 1; if (column == 5) { row += 1; column = 0; } } GUI.EndScrollView(); UnitTB selectedUnit = null; if (tab == _Tab.Available) { selectedUnit = availableUnits[selectedID]; } else if (tab == _Tab.Selected) { selectedUnit = selectedUnits[selectedID]; } DrawSelectedUnit(selectedUnit); }
public static void Build(UISetup uiSetup) {
private void OnEnable() { _target = (UISetup)target; }
public override void OnInspectorGUI() { uiSetup = (UISetup)target; //DrawDefaultInspector(); EditorGUILayout.Space(); int loadMode = (int)uiSetup.loadMode; cont = new GUIContent("Data Load Mode:", "Data loading mode to be used in this scene"); contL = new GUIContent[loadModeLabel.Length]; for (int i = 0; i < contL.Length; i++) { contL[i] = new GUIContent(loadModeLabel[i], loadModeTooltip[i]); } loadMode = EditorGUILayout.IntPopup(cont, loadMode, contL, intVal); uiSetup.loadMode = (_LoadMode)loadMode; EditorGUILayout.Space(); if (uiSetup.loadMode != _LoadMode.UsePersistantData) { cont = new GUIContent("Starting Point:", "points available for the player to purchase unit and perk"); uiSetup.startingPlayerPoint = EditorGUILayout.IntField(cont, uiSetup.startingPlayerPoint); } EditorGUILayout.Space(); cont = new GUIContent("Main Menu:", "the name of the main menu scene"); uiSetup.mainMenu = EditorGUILayout.TextField(cont, uiSetup.mainMenu); EditorGUILayout.Space(); cont = new GUIContent("Random Next Scene:", "Check to randomise which scene to load next"); uiSetup.randomNextScene = EditorGUILayout.Toggle(cont, uiSetup.randomNextScene); if (!uiSetup.randomNextScene) { cont = new GUIContent("Next Scene:", "the name of next scene to be load"); uiSetup.nextScene = EditorGUILayout.TextField(cont, uiSetup.nextScene); } else { int count = uiSetup.nextScenes.Count; cont = new GUIContent("Next Scenes Count:", "the number of potential next scenes to be load"); count = EditorGUILayout.IntField(cont, count); if (count != uiSetup.nextScenes.Count) { if (uiSetup.nextScenes.Count < count) { for (int i = uiSetup.nextScenes.Count; i < count; i++) { uiSetup.nextScenes.Add(""); } } else { List <string> newList = new List <string>(); for (int i = 0; i < count; i++) { newList.Add(uiSetup.nextScenes[i]); } uiSetup.nextScenes = newList; } } for (int i = 0; i < uiSetup.nextScenes.Count; i++) { uiSetup.nextScenes[i] = EditorGUILayout.TextField(" - ", uiSetup.nextScenes[i]); } } if (GUI.changed) { EditorUtility.SetDirty(uiSetup); } }
void Awake() { uiSetup = (UISetup)target; InitLabel(); }