-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from JohannesDeml/quick-cleanup
Quick cleanups
- Loading branch information
Showing
9 changed files
with
68 additions
and
78 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,45 +1,47 @@ | ||
using Polyglot; | ||
using UnityEngine; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class DownloadPolyglotSheetButton : MonoBehaviour | ||
namespace Polyglot | ||
{ | ||
[SerializeField] | ||
private Button button; | ||
public class DownloadPolyglotSheetButton : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private Button button; | ||
|
||
[SerializeField] | ||
private RectTransform progressbar; | ||
[SerializeField] | ||
private RectTransform progressbar = null; | ||
|
||
private float startWidth; | ||
private float startWidth; | ||
|
||
private void Reset() | ||
{ | ||
button = GetComponent<Button>(); | ||
} | ||
|
||
private void OnEnable() | ||
{ | ||
startWidth = progressbar.sizeDelta.x; | ||
button.onClick.AddListener(OnClick); | ||
} | ||
private void Reset() | ||
{ | ||
button = GetComponent<Button>(); | ||
} | ||
|
||
private void OnDisable() | ||
{ | ||
button.onClick.RemoveListener(OnClick); | ||
} | ||
private void OnEnable() | ||
{ | ||
startWidth = progressbar.sizeDelta.x; | ||
button.onClick.AddListener(OnClick); | ||
} | ||
|
||
private void OnClick() | ||
{ | ||
StartCoroutine(LocalizationImporter.DownloadPolyglotSheet(UpdateProgressbar)); | ||
} | ||
private void OnDisable() | ||
{ | ||
button.onClick.RemoveListener(OnClick); | ||
} | ||
|
||
private bool UpdateProgressbar(float progress) | ||
{ | ||
if (progressbar != null) | ||
private void OnClick() | ||
{ | ||
progressbar.sizeDelta = new Vector2(progress * startWidth, progressbar.sizeDelta.y); | ||
StartCoroutine(LocalizationImporter.DownloadPolyglotSheet(UpdateProgressbar)); | ||
} | ||
|
||
return false; | ||
private bool UpdateProgressbar(float progress) | ||
{ | ||
if (progressbar != null) | ||
{ | ||
progressbar.sizeDelta = new Vector2(progress * startWidth, progressbar.sizeDelta.y); | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
using JetBrains.Annotations; | ||
#endif | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
namespace Polyglot | ||
{ | ||
|