Compare commits
2 Commits
2d35e3177b
...
174f616e5c
Author | SHA1 | Date | |
---|---|---|---|
174f616e5c | |||
0f8bb5f1f6 |
@@ -10,6 +10,11 @@ namespace Cryville.Common.Unity {
|
|||||||
|
|
||||||
float timer = 0;
|
float timer = 0;
|
||||||
|
|
||||||
|
const float DURATION = 5.0f;
|
||||||
|
const float DURIN = 0.4f;
|
||||||
|
const float DUROUT = 0.4f;
|
||||||
|
const float HEIGHT = 50f;
|
||||||
|
|
||||||
#pragma warning disable IDE0051
|
#pragma warning disable IDE0051
|
||||||
void Start() {
|
void Start() {
|
||||||
layout = GetComponent<LayoutElement>();
|
layout = GetComponent<LayoutElement>();
|
||||||
@@ -19,9 +24,9 @@ namespace Cryville.Common.Unity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Update() {
|
void Update() {
|
||||||
if (timer <= 0.8f) layout.minHeight = timer * 50;
|
if (timer <= DURIN) layout.minHeight = timer / DURIN * HEIGHT;
|
||||||
else if (timer >= 5f) GameObject.Destroy(gameObject);
|
else if (timer >= DURATION) GameObject.Destroy(gameObject);
|
||||||
else if (timer >= 4.2f) layout.minHeight = (300 - timer) * 50;
|
else if (timer >= DURATION - DUROUT) layout.minHeight = (DURATION - timer) / DUROUT * HEIGHT;
|
||||||
timer += Time.deltaTime;
|
timer += Time.deltaTime;
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE0051
|
#pragma warning restore IDE0051
|
||||||
|
@@ -116,7 +116,14 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
if (!converters.ContainsKey(file.Extension)) return false;
|
if (!converters.ContainsKey(file.Extension)) return false;
|
||||||
foreach (var converter in converters[file.Extension]) {
|
foreach (var converter in converters[file.Extension]) {
|
||||||
var resources = converter.ConvertFrom(file);
|
IEnumerable<Resource> resources = null;
|
||||||
|
try {
|
||||||
|
resources = converter.ConvertFrom(file);
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
CallHelper.ShowMessageBox(ex.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
foreach (var res in resources) {
|
foreach (var res in resources) {
|
||||||
if (!res.Valid) {
|
if (!res.Valid) {
|
||||||
Logger.Log("main", 3, "Resource", "Attempt to import invalid resource {0}", res);
|
Logger.Log("main", 3, "Resource", "Attempt to import invalid resource {0}", res);
|
||||||
|
@@ -59,11 +59,11 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
private void OnAddDialogClosed() {
|
private void OnAddDialogClosed() {
|
||||||
if (_dialog.FileName == null) return;
|
if (_dialog.FileName == null) return;
|
||||||
if (ResourceManager.ImportItemFrom(_dialog.FileName)) {
|
if (ResourceManager.ImportItemFrom(_dialog.FileName)) {
|
||||||
Debug.Log("Import succeeded"); // TODO
|
CallHelper.ShowMessageBox("Import succeeded");
|
||||||
OnPathClicked(ResourceManager.CurrentDirectory.Length - 1);
|
OnPathClicked(ResourceManager.CurrentDirectory.Length - 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Debug.Log("Import failed"); // TODO
|
CallHelper.ShowMessageBox("Import failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user