Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit f41d8ad

Browse files
Improved BarChart example
- New editor buttons - Improved readme
1 parent bbf3548 commit f41d8ad

File tree

14 files changed

+6240
-681
lines changed

14 files changed

+6240
-681
lines changed

‎Assets/Common/Scripts/VerticalText.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Text;
2+
using UnityEngine;
3+
using UnityEngine.UI;
4+
5+
namespace Assets.Common.Scripts {
6+
7+
[AddComponentMenu("Scripts/Common/Vertical Text")]
8+
[RequireComponent(typeof(Text))]
9+
[ExecuteInEditMode]
10+
public class VerticalText : MonoBehaviour {
11+
12+
// Use this for initialization
13+
private void OnEnable() {
14+
string input = GetComponent<Text>().text;
15+
StringBuilder sb = new StringBuilder(input.Length * 2);
16+
foreach (char chr in input) {
17+
sb.Append(chr).Append("\n");
18+
}
19+
20+
GetComponent<Text>().text = sb.ToString();
21+
}
22+
}
23+
24+
}

‎Assets/Common/Scripts/VerticalText.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/ScreenSpace/BarChart/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@
44
### Description
55
A bar chart implemented in Unity, with help from the [Percentage Based](https://github.com/LewisJohnson/unity-ui-examples/tree/master/Assets/ScreenSpace/PercentageBased) example.
66

7+
8+
| Custom | Solid | Gradient | Similar Shade |
9+
|-------------------------|------------------|---------------------|--------------------------|
10+
| ![](./readme-image.jpg) | ![](./solid.png) | ![](./gradient.png) | ![](./similar-shade.png) |
11+
12+
| Similar Colour | Random | Random Soft | Random RGB |
13+
|---------------------------|------------------|---------------------|--------------------------|
14+
| ![](./similar-colour.jpg) | ![](./random-rgb.png) | ![](./random-soft.png) | ![](./random-rgb.png) |
15+
716
#### Included:
817
* Bar chart
918
* Bar chart Editor
10-
11-
#### Todo:
1219
* Bar chart colour settings
1320
* Bar chart title setting
1421

22+
1523
### Supported aspect ratios
1624
* 5:4 ✅
1725
* 4:3 ✅

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /