-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vawlpe <[email protected]>
- Loading branch information
Showing
6 changed files
with
84 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace ModTaker | ||
{ | ||
public class AssetScanner | ||
{ | ||
public static Dictionary<String, Sprite> ScanSpritesInScene(String sceneName) | ||
{ | ||
var objs = from GameObject go in GameObject.FindObjectsOfType(typeof(GameObject)) where go.scene.name == sceneName select go; | ||
var sprites = new Dictionary<String, Sprite>(); | ||
foreach (GameObject go in objs) | ||
{ | ||
try { | ||
foreach (var sr in go.GetComponentsInChildren<SpriteRenderer>()) | ||
if (sr.sprite != null) sprites.Add(sr.sprite.name, sr.sprite); | ||
foreach (var im in go.GetComponentsInChildren<Image>()) | ||
if (im.sprite != null) sprites.Add(im.sprite.name, im.sprite); | ||
foreach (var sr in go.GetComponents<SpriteRenderer>()) | ||
if (sr.sprite != null) sprites.Add(sr.sprite.name, sr.sprite); | ||
foreach (var im in go.GetComponents<Image>()) | ||
if (im.sprite != null) sprites.Add(im.sprite.name, im.sprite); | ||
} catch (System.Exception e) { | ||
Debug.LogError(e); | ||
continue; | ||
} | ||
} | ||
return sprites; | ||
} | ||
} | ||
} |
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,7 +1,10 @@ | ||
using UnityEngine; | ||
|
||
namespace ModTaker | ||
{ | ||
public static class Global | ||
{ | ||
public static bool EnableSteam = false; | ||
public static Dictionary<String, Sprite> Sprites; | ||
} | ||
} |
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,13 @@ | ||
using UnityEngine; | ||
|
||
namespace ModTaker.UI.Helltaker | ||
{ | ||
public class Button : UIButton | ||
{ | ||
public override GameObject Build() | ||
{ | ||
this.Sprite = Global.Sprites["button0003"]; | ||
return base.Build(); | ||
} | ||
} | ||
} |
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