|
@@ -9,6 +9,7 @@ namespace ScrapYard
|
|
|
public class ScrapYardGenerator
|
|
public class ScrapYardGenerator
|
|
|
{
|
|
{
|
|
|
private static readonly FieldInfo chunksField = typeof(SpawnerScript).GetField("chunks", BindingFlags.NonPublic | BindingFlags.Instance);
|
|
private static readonly FieldInfo chunksField = typeof(SpawnerScript).GetField("chunks", BindingFlags.NonPublic | BindingFlags.Instance);
|
|
|
|
|
+ private static readonly Material materialaBackLight = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("parallax.png") };
|
|
|
private static readonly Material materialaParalex0 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bScrapYardbg0.png") };
|
|
private static readonly Material materialaParalex0 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bScrapYardbg0.png") };
|
|
|
private static readonly Material materialaParalex1 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bScrapYardbg1.png") };
|
|
private static readonly Material materialaParalex1 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bScrapYardbg1.png") };
|
|
|
private static readonly Material materialaParalex2 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bScrapYardbg2.png") };
|
|
private static readonly Material materialaParalex2 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bScrapYardbg2.png") };
|
|
@@ -23,6 +24,7 @@ namespace ScrapYard
|
|
|
{
|
|
{
|
|
|
s.backLights.SetActive(true);
|
|
s.backLights.SetActive(true);
|
|
|
s.mainLight.SetActive(true);
|
|
s.mainLight.SetActive(true);
|
|
|
|
|
+ s.backLights.GetComponent<Renderer>().material = materialaBackLight;
|
|
|
s.mainLight.GetComponentInChildren<Light>().color = new Color(0.05f, 0.05f, 0.05f, 0.1f);
|
|
s.mainLight.GetComponentInChildren<Light>().color = new Color(0.05f, 0.05f, 0.05f, 0.1f);
|
|
|
|
|
|
|
|
s.bg[0].GetComponent<Renderer>().material = materialaParalex0;
|
|
s.bg[0].GetComponent<Renderer>().material = materialaParalex0;
|
|
@@ -40,7 +42,7 @@ namespace ScrapYard
|
|
|
int rowsNeeded = 0;
|
|
int rowsNeeded = 0;
|
|
|
foreach (var entry in ShopPlatform.ShopPlatforms)
|
|
foreach (var entry in ShopPlatform.ShopPlatforms)
|
|
|
{
|
|
{
|
|
|
- rowsNeeded += entry.GetRowsNeeded();
|
|
|
|
|
|
|
+ rowsNeeded += entry.Value.GetRowsNeeded();
|
|
|
}
|
|
}
|
|
|
int extensionAmount = System.Math.Max((rowsNeeded + 3) / 8, 0);
|
|
int extensionAmount = System.Math.Max((rowsNeeded + 3) / 8, 0);
|
|
|
for (int i = 0; i < extensionAmount; i++)
|
|
for (int i = 0; i < extensionAmount; i++)
|
|
@@ -87,16 +89,16 @@ namespace ScrapYard
|
|
|
int rowNumber = -1;
|
|
int rowNumber = -1;
|
|
|
foreach (var platform in ShopPlatform.ShopPlatforms)
|
|
foreach (var platform in ShopPlatform.ShopPlatforms)
|
|
|
{
|
|
{
|
|
|
- for (int i = 0; i < platform.Entries.Count; i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < platform.Value.Entries.Count; i++)
|
|
|
{
|
|
{
|
|
|
- ShopPlatformEntry entry = platform.Entries[i];
|
|
|
|
|
- if ((i % platform.GetSpacesPerRow()) == 0)
|
|
|
|
|
|
|
+ ShopPlatformEntry entry = platform.Value.Entries[i];
|
|
|
|
|
+ if ((i % platform.Value.GetSpacesPerRow()) == 0)
|
|
|
{
|
|
{
|
|
|
rowNumber++;
|
|
rowNumber++;
|
|
|
networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("prop/ScrapYard/metalPlatform"), new Vector3(300, rowNumber * 8f, 0.4f), Quaternion.identity, 0);
|
|
networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("prop/ScrapYard/metalPlatform"), new Vector3(300, rowNumber * 8f, 0.4f), Quaternion.identity, 0);
|
|
|
temp++;
|
|
temp++;
|
|
|
}
|
|
}
|
|
|
- var step = (i % platform.GetSpacesPerRow()) / (float)(platform.GetSpacesPerRow() - 1);
|
|
|
|
|
|
|
+ var step = (i % platform.Value.GetSpacesPerRow()) / (float)(platform.Value.GetSpacesPerRow() - 1);
|
|
|
networkStuff[temp] = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(300 - (40 / 2) + (step * 40), rowNumber * 8f + 0.5f - 0.05f, 0.2f), Quaternion.identity, 0);
|
|
networkStuff[temp] = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(300 - (40 / 2) + (step * 40), rowNumber * 8f + 0.5f - 0.05f, 0.2f), Quaternion.identity, 0);
|
|
|
networkStuff[temp].GetComponent<ScrapYardShopStandScript>().StartCallSet(entry.ItemID, entry.Price, entry.Quantity, entry.CurrencyItemID);
|
|
networkStuff[temp].GetComponent<ScrapYardShopStandScript>().StartCallSet(entry.ItemID, entry.Price, entry.Quantity, entry.CurrencyItemID);
|
|
|
temp++;
|
|
temp++;
|