|
@@ -38,7 +38,11 @@ namespace ScrapYard
|
|
|
Texture2D texturePlanetIcon = GadgetCoreAPI.LoadTexture2D("planetScrapYard.png");
|
|
Texture2D texturePlanetIcon = GadgetCoreAPI.LoadTexture2D("planetScrapYard.png");
|
|
|
Texture2D texturePlanetPrevIcon = GadgetCoreAPI.LoadTexture2D("planetScrapYardPrev.png");
|
|
Texture2D texturePlanetPrevIcon = GadgetCoreAPI.LoadTexture2D("planetScrapYardPrev.png");
|
|
|
Texture2D texturePortalSign = GadgetCoreAPI.LoadTexture2D("signScrapYard.png");
|
|
Texture2D texturePortalSign = GadgetCoreAPI.LoadTexture2D("signScrapYard.png");
|
|
|
|
|
+
|
|
|
Texture2D textureBG = GadgetCoreAPI.LoadTexture2D("bgScrapYard.png");
|
|
Texture2D textureBG = GadgetCoreAPI.LoadTexture2D("bgScrapYard.png");
|
|
|
|
|
+ Texture2D textureBGExtension = GadgetCoreAPI.LoadTexture2D("bgScrapYardExtension.png");
|
|
|
|
|
+ Texture2D textureBGTop = GadgetCoreAPI.LoadTexture2D("bgScrapYardTop.png");
|
|
|
|
|
+
|
|
|
Texture2D textureParalex = GadgetCoreAPI.LoadTexture2D("parallax.png");
|
|
Texture2D textureParalex = GadgetCoreAPI.LoadTexture2D("parallax.png");
|
|
|
Texture2D textureParalex0 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg0.png");
|
|
Texture2D textureParalex0 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg0.png");
|
|
|
Texture2D textureParalex1 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg1.png");
|
|
Texture2D textureParalex1 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg1.png");
|
|
@@ -52,14 +56,18 @@ namespace ScrapYard
|
|
|
Texture2D textureMid0 = GadgetCoreAPI.LoadTexture2D("midScrapYardChunk0.png");
|
|
Texture2D textureMid0 = GadgetCoreAPI.LoadTexture2D("midScrapYardChunk0.png");
|
|
|
Texture2D textureMid1 = GadgetCoreAPI.LoadTexture2D("midScrapYardChunk1.png");
|
|
Texture2D textureMid1 = GadgetCoreAPI.LoadTexture2D("midScrapYardChunk1.png");
|
|
|
|
|
|
|
|
- PlanetInfo scrapYardPlanet = new PlanetInfo(PlanetType.SINGLE, "Scrap Yard", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) });
|
|
|
|
|
|
|
+ PlanetInfo scrapYardPlanet = new PlanetInfo(PlanetType.SPECIAL, "Scrap Yard", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) });
|
|
|
scrapYardPlanet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
|
|
scrapYardPlanet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
|
|
|
scrapYardPlanet.SetBackgroundInfo(textureParalex, textureParalex0, textureParalex1, textureParalex2, textureParalex3);
|
|
scrapYardPlanet.SetBackgroundInfo(textureParalex, textureParalex0, textureParalex1, textureParalex2, textureParalex3);
|
|
|
scrapYardPlanet.SetTerrainInfo(textureEntrance, textureBG, textureMid0, textureMid1, textureBigSide, textureSmallSide);
|
|
scrapYardPlanet.SetTerrainInfo(textureEntrance, textureBG, textureMid0, textureMid1, textureBigSide, textureSmallSide);
|
|
|
|
|
|
|
|
- scrapYardPlanet.OnGenerateInsideTown += GenerateTown;
|
|
|
|
|
|
|
+ //scrapYardPlanet.OnGenerateInsideTown += GenerateTown;
|
|
|
scrapYardPlanet.PortalUses = 300;
|
|
scrapYardPlanet.PortalUses = 300;
|
|
|
|
|
|
|
|
|
|
+ scrapYardPlanet.OnGenerateWorld += ScrapYardGenerator.GenarateTown;
|
|
|
|
|
+
|
|
|
|
|
+ scrapYardPlanet.Register("Scrap Yard");
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
var scrapYardShopBuilding = Object.Instantiate((GameObject)Resources.Load("prop/2501"));
|
|
var scrapYardShopBuilding = Object.Instantiate((GameObject)Resources.Load("prop/2501"));
|
|
|
scrapYardShopBuilding.transform.localScale *= 8;
|
|
scrapYardShopBuilding.transform.localScale *= 8;
|
|
@@ -76,35 +84,105 @@ namespace ScrapYard
|
|
|
var scrapYardMerchant = Object.Instantiate((GameObject)Resources.Load("npc/perceval"));
|
|
var scrapYardMerchant = Object.Instantiate((GameObject)Resources.Load("npc/perceval"));
|
|
|
Texture2D textureBody = GadgetCoreAPI.LoadTexture2D("merchantBody.png");
|
|
Texture2D textureBody = GadgetCoreAPI.LoadTexture2D("merchantBody.png");
|
|
|
Texture2D textureHead = GadgetCoreAPI.LoadTexture2D("merchantHead.png");
|
|
Texture2D textureHead = GadgetCoreAPI.LoadTexture2D("merchantHead.png");
|
|
|
|
|
+
|
|
|
var gameObjectBody = scrapYardMerchant.transform.Find("e").Find("perceval").FindChild("Plane_002");
|
|
var gameObjectBody = scrapYardMerchant.transform.Find("e").Find("perceval").FindChild("Plane_002");
|
|
|
var rendererBody = gameObjectBody.gameObject.GetComponentInChildren<Renderer>();
|
|
var rendererBody = gameObjectBody.gameObject.GetComponentInChildren<Renderer>();
|
|
|
rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
|
{
|
|
{
|
|
|
mainTexture = textureBody
|
|
mainTexture = textureBody
|
|
|
};
|
|
};
|
|
|
- rendererBody.transform.position = new Vector3(0, 0, 0.1f);
|
|
|
|
|
|
|
+
|
|
|
var gameObjectHead = scrapYardMerchant.transform.Find("e").Find("perceval").FindChild("Plane");
|
|
var gameObjectHead = scrapYardMerchant.transform.Find("e").Find("perceval").FindChild("Plane");
|
|
|
var rendererHead = gameObjectHead.gameObject.GetComponentInChildren<Renderer>();
|
|
var rendererHead = gameObjectHead.gameObject.GetComponentInChildren<Renderer>();
|
|
|
rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
|
{
|
|
{
|
|
|
mainTexture = textureHead
|
|
mainTexture = textureHead
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ scrapYardMerchant.transform.Find("e").rotation = Quaternion.Euler(0f, 180f, 0f);
|
|
|
|
|
+
|
|
|
Component.DestroyImmediate(scrapYardMerchant.GetComponent<npcTurnScript>());
|
|
Component.DestroyImmediate(scrapYardMerchant.GetComponent<npcTurnScript>());
|
|
|
GadgetCoreAPI.AddCustomResource("prop/ScrapYard/scrapYardMerchant", scrapYardMerchant);
|
|
GadgetCoreAPI.AddCustomResource("prop/ScrapYard/scrapYardMerchant", scrapYardMerchant);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- scrapYardPlanet.Register("Scrap Yard");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
|
|
|
|
|
|
|
|
|
|
+ var rendererBody = gameObject.GetComponentInChildren<Renderer>();
|
|
|
|
|
+ rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
|
|
|
+ {
|
|
|
|
|
+ mainTexture = textureBG
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- private static IEnumerable<GameObject> GenerateTown(Chunk chunk)
|
|
|
|
|
- {
|
|
|
|
|
- var list = new List<GameObject>();
|
|
|
|
|
|
|
+ for (int i = 0; i < 6; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
|
|
|
|
|
+ for (int i = 0; i < 16; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
|
|
|
|
|
+
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(7).localScale += new Vector3(1.5f, 0, 0);
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(5).gameObject);
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(1).gameObject);
|
|
|
|
|
+
|
|
|
|
|
+ Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
|
|
|
|
|
+ GadgetCoreAPI.AddCustomResource("z/ScrapYard/chunkBase", gameObject);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
|
|
|
|
|
|
|
|
- list.Add((GameObject)Network.Instantiate(Resources.Load("prop/ScrapYard/scrapYardShopBuilding"), new Vector3(250f, -6f + 0.118f, 0.3f), Quaternion.identity, 0));
|
|
|
|
|
- list.Add((GameObject)Network.Instantiate(Resources.Load("prop/ScrapYard/scrapYardMerchant"), new Vector3(255f, -6f - 0.118f * 12, 0.2f), Quaternion.identity, 0));
|
|
|
|
|
|
|
+ var rendererBody = gameObject.GetComponentInChildren<Renderer>();
|
|
|
|
|
+ rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
|
|
|
+ {
|
|
|
|
|
+ mainTexture = textureBGExtension
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < 6; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
|
|
|
|
|
+ for (int i = 0; i < 16; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < 6; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
|
|
|
|
|
+
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(0).localScale = new Vector3(0.4375f, 2, 1);
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(0).localPosition = new Vector3(0.78125f, 0, 0);
|
|
|
|
|
+
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(1).localScale = new Vector3(0.4375f, 2, 1);
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(1).localPosition = new Vector3(-0.78125f, 0, 0);
|
|
|
|
|
+
|
|
|
|
|
+ Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
|
|
|
|
|
+ GadgetCoreAPI.AddCustomResource("z/ScrapYard/chunkExtension", gameObject);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
|
|
|
|
|
|
|
|
- return list;
|
|
|
|
|
|
|
+ var rendererBody = gameObject.GetComponentInChildren<Renderer>();
|
|
|
|
|
+ rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
|
|
|
|
|
+ {
|
|
|
|
|
+ mainTexture = textureBGTop
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < 6; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
|
|
|
|
|
+ for (int i = 0; i < 16; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < 5; i++)
|
|
|
|
|
+ GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
|
|
|
|
|
+
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(0).localPosition = new Vector3(0.78125f, 0, 0);
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(0).localScale = new Vector3(0.4375f, 2, 1);
|
|
|
|
|
+
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(1).localPosition = new Vector3(-0.78125f, 0, 0);
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(1).localScale = new Vector3(0.4375f, 2, 1);
|
|
|
|
|
+
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(2).localPosition = new Vector3(0, 0.5f, 0);
|
|
|
|
|
+ gameObject.transform.GetChild(0).GetChild(2).localScale = new Vector3(2f, 0.5f, 1);
|
|
|
|
|
+
|
|
|
|
|
+ Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
|
|
|
|
|
+ GadgetCoreAPI.AddCustomResource("z/ScrapYard/chunkTop", gameObject);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|