修改UI
This commit is contained in:
@@ -5,22 +5,22 @@ namespace NBF
|
||||
{
|
||||
public static class GObjectExtensions
|
||||
{
|
||||
public static void SetQuality(this GImage image, uint quality)
|
||||
public static void SetQuality(this GImage image, int quality)
|
||||
{
|
||||
image.color = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
|
||||
public static void SetQuality(this GTextField image, uint quality)
|
||||
public static void SetQuality(this GTextField image, int quality)
|
||||
{
|
||||
image.strokeColor = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
|
||||
public static void SetTitleQuality(this GButton com, uint quality)
|
||||
public static void SetTitleQuality(this GButton com, int quality)
|
||||
{
|
||||
com.GetTextField().strokeColor = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
|
||||
public static void SetTitleQuality(this GTextField com, uint quality)
|
||||
public static void SetTitleQuality(this GTextField com, int quality)
|
||||
{
|
||||
com.strokeColor = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
|
||||
@@ -7,34 +7,25 @@ namespace NBF
|
||||
{
|
||||
public static class IConfigTableExtensions
|
||||
{
|
||||
public static string GetName(this IConfigTable config)
|
||||
{
|
||||
return config.Key.GetName();
|
||||
}
|
||||
|
||||
public static string GetDesc(this IConfigTable config)
|
||||
{
|
||||
return config.Key.GetDesc();
|
||||
}
|
||||
|
||||
public static string GetModelPath(this ItemConfig config)
|
||||
|
||||
public static string GetModelPath(this cfg.Item config)
|
||||
{
|
||||
return $"Assets/ResRaw/gfx/{config.Model}.prefab";
|
||||
}
|
||||
|
||||
public static GameObject GetModelPrefab(this ItemConfig config)
|
||||
public static GameObject GetModelPrefab(this cfg.Item config)
|
||||
{
|
||||
return Assets.Load<GameObject>(config.GetModelPath());
|
||||
}
|
||||
|
||||
public static GameObject Instantiate(this ItemConfig config, Transform parent, Vector3 position,
|
||||
public static GameObject Instantiate(this cfg.Item config, Transform parent, Vector3 position,
|
||||
Quaternion rotation)
|
||||
{
|
||||
return Object.Instantiate(config.GetModelPrefab(), position, rotation, parent);
|
||||
}
|
||||
|
||||
|
||||
public static T InstantiateAndComponent<T>(this ItemConfig config, Transform parent, Vector3 position,
|
||||
public static T InstantiateAndComponent<T>(this cfg.Item config, Transform parent, Vector3 position,
|
||||
Quaternion rotation) where T : MonoBehaviour
|
||||
{
|
||||
var obj = config.Instantiate(parent, position, rotation);
|
||||
@@ -47,7 +38,7 @@ namespace NBF
|
||||
return com;
|
||||
}
|
||||
|
||||
public static T InstantiateAndComponent<T>(this ItemConfig config) where T : MonoBehaviour
|
||||
public static T InstantiateAndComponent<T>(this cfg.Item config) where T : MonoBehaviour
|
||||
{
|
||||
var obj = Object.Instantiate(config.GetModelPrefab());
|
||||
var com = obj.GetComponent<T>();
|
||||
|
||||
Reference in New Issue
Block a user