Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Building list changes
-Adapted UI to give it dynamic resolution (both in terms of position and size). -Created and used graphics for objects.
- Loading branch information
Showing
27 changed files
with
655 additions
and
39 deletions.
There are no files selected for viewing
BIN
-373 KB
(54%)
.vs/206CDE/v16/.suo
Binary file not shown.
BIN
+4 KB
(100%)
.vs/206CDE/v16/Server/sqlite3/storage.ide
Binary file not shown.
Binary file not shown.
BIN
-3.93 MB
.vs/206CDE/v16/Server/sqlite3/storage.ide-wal
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class BuildingListResize : MonoBehaviour | ||
{ | ||
private GameObject curObject; //use this for every game object I need to adjust (not just buttons) | ||
|
||
//resize building list as soon as scene is loaded | ||
void Awake() | ||
{ | ||
/* see MainMenuResize.cs for an explanation of why this | ||
* Update function is being called here. */ | ||
Update(); | ||
|
||
curObject = GameObject.Find("ButtonListContent"); | ||
curObject.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f); | ||
} | ||
|
||
//resize building list at every frame update | ||
void Update() | ||
{ | ||
curObject = GameObject.Find("Scrollbar"); //get scrollbar first | ||
|
||
/* place scroll bar far right of screen (*0.98f so scroll bar is still on screen) | ||
* with vertical centre. */ | ||
curObject.transform.position = new Vector3(Screen.width*0.97f, Screen.height*0.5f); | ||
|
||
//appealing dynamic size (as opposed to dynamic position) for scroll bar | ||
curObject.GetComponent<RectTransform>().sizeDelta = new Vector3(Screen.height * 0.06f, Screen.height * 0.75f); | ||
|
||
|
||
|
||
curObject = GameObject.Find("ScrollList"); //get ScrollList | ||
|
||
//put ScrollList in centre of screen | ||
curObject.transform.position = new Vector3(Screen.width*0.5f, Screen.height*0.5f); | ||
|
||
//adjust size of ScrollList to cover whole screen | ||
curObject.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width, Screen.height); | ||
|
||
curObject = GameObject.Find("ButtonLimiter"); //get panel used for defining button boundaries next | ||
curObject.transform.position = new Vector3(Screen.width * 0.5f, Screen.height * 0.5f); //put in centre | ||
//make the object size look appealing at different resoltuions | ||
curObject.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width*0.9f, Screen.height * 0.9f); | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.