Skip to content

Commit 5d95db9

Browse files
author
JunichiEnomoto
committed
refactoring : All
1 parent 973cf62 commit 5d95db9

24 files changed

Lines changed: 903 additions & 709 deletions

.idea/.idea.RubyTextMeshPro/.idea/codeStyles/codeStyleConfig.xml

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

.idea/.idea.RubyTextMeshPro/.idea/indexLayout.xml

Lines changed: 3 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Collections;
2-
using System.Collections.Generic;
32
using TMPro;
43
using UnityEngine;
54

@@ -8,9 +7,7 @@ public class SampleRubyTMP : MonoBehaviour
87
{
98
public float span = 3f;
109

11-
RubyTextMeshPro rubyTextMeshPro;
12-
13-
string[] strArray = new string[]
10+
private readonly string[] strArray =
1411
{
1512
"<ruby=いち>壱</ruby>",
1613
"<ruby=に>弐</ruby>",
@@ -21,36 +18,38 @@ public class SampleRubyTMP : MonoBehaviour
2118
"<ruby=しち>漆</ruby>",
2219
"<ruby=はち>捌</ruby>",
2320
"<ruby=きゅう>玖</ruby>",
24-
"<ruby=じゅう>拾</ruby>",
21+
"<ruby=じゅう>拾</ruby>"
2522
};
2623

27-
int strIndex;
24+
private RubyTextMeshPro rubyTextMeshPro;
25+
26+
private int strIndex;
2827

2928
// Start is called before the first frame update
30-
void Start()
29+
private void Start()
3130
{
32-
rubyTextMeshPro = GetComponent<RubyTextMeshPro>();
33-
StartCoroutine(TimeUpdate());
31+
this.rubyTextMeshPro = this.GetComponent<RubyTextMeshPro>();
32+
this.StartCoroutine(this.TimeUpdate());
3433
}
3534

3635
// Update is called once per frame
37-
IEnumerator TimeUpdate()
36+
private IEnumerator TimeUpdate()
3837
{
3938
while (true)
4039
{
41-
yield return new WaitForSeconds(span);
42-
UpdateText();
40+
yield return new WaitForSeconds(this.span);
41+
this.UpdateText();
4342
}
4443
}
4544

46-
void UpdateText()
45+
private void UpdateText()
4746
{
48-
rubyTextMeshPro.UnditedText = strArray[strIndex];
49-
strIndex++;
47+
this.rubyTextMeshPro.uneditedText = this.strArray[this.strIndex];
48+
this.strIndex++;
49+
5050
if (this.strArray.Length <= this.strIndex)
5151
{
5252
this.strIndex = 0;
5353
}
5454
}
55-
56-
}
55+
}
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Collections;
2-
using System.Collections.Generic;
32
using TMPro;
43
using UnityEngine;
54

@@ -8,9 +7,7 @@ public class SampleRubyTMPUGUI : MonoBehaviour
87
{
98
public float span = 3f;
109

11-
RubyTextMeshProUGUI rubyTextMeshPro;
12-
13-
string[] strArray = new string[]
10+
private readonly string[] strArray =
1411
{
1512
"<ruby=いち>壱</ruby>",
1613
"<ruby=に>弐</ruby>",
@@ -21,36 +18,38 @@ public class SampleRubyTMPUGUI : MonoBehaviour
2118
"<ruby=しち>漆</ruby>",
2219
"<ruby=はち>捌</ruby>",
2320
"<ruby=きゅう>玖</ruby>",
24-
"<ruby=じゅう>拾</ruby>",
21+
"<ruby=じゅう>拾</ruby>"
2522
};
2623

27-
int strIndex;
24+
private RubyTextMeshProUGUI rubyTextMeshPro;
25+
26+
private int strIndex;
2827

2928
// Start is called before the first frame update
30-
void Start()
29+
private void Start()
3130
{
32-
rubyTextMeshPro = GetComponent<RubyTextMeshProUGUI>();
33-
StartCoroutine(TimeUpdate());
31+
this.rubyTextMeshPro = this.GetComponent<RubyTextMeshProUGUI>();
32+
this.StartCoroutine(this.TimeUpdate());
3433
}
3534

3635
// Update is called once per frame
37-
IEnumerator TimeUpdate()
36+
private IEnumerator TimeUpdate()
3837
{
3938
while (true)
4039
{
41-
yield return new WaitForSeconds(span);
42-
UpdateText();
40+
yield return new WaitForSeconds(this.span);
41+
this.UpdateText();
4342
}
4443
}
4544

46-
void UpdateText()
45+
private void UpdateText()
4746
{
48-
rubyTextMeshPro.UnditedText = strArray[strIndex];
49-
strIndex++;
47+
this.rubyTextMeshPro.uneditedText = this.strArray[this.strIndex];
48+
this.strIndex++;
49+
5050
if (this.strArray.Length <= this.strIndex)
5151
{
5252
this.strIndex = 0;
5353
}
5454
}
55-
5655
}

0 commit comments

Comments
 (0)