|
@@ -105,39 +105,42 @@ namespace ScrapYard
|
|
|
yield return new WaitForSeconds(0.25f);
|
|
yield return new WaitForSeconds(0.25f);
|
|
|
}
|
|
}
|
|
|
yield return new WaitForSeconds(0.75f);
|
|
yield return new WaitForSeconds(0.75f);
|
|
|
- try
|
|
|
|
|
|
|
+ if (Network.isServer)
|
|
|
{
|
|
{
|
|
|
|
|
+ try
|
|
|
{
|
|
{
|
|
|
- var stand = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(-250f + 4 * -5.5f, -5.99f - 2 + 0.5f, 0.19f), Quaternion.identity, 0);
|
|
|
|
|
- stand.GetComponent<ScrapYardShopStandScript>().GetComponent<ScrapYardShopStandScript>().StartCallSet(ItemRegistry.GetItemIDByRegistryName("ScrapYard:Scrap Trophy"), 9999, 1, 57);
|
|
|
|
|
- }
|
|
|
|
|
- List<ShopPlatformEntry> blocks = new List<ShopPlatformEntry>();
|
|
|
|
|
- List<ShopPlatformEntry> objects = new List<ShopPlatformEntry>();
|
|
|
|
|
- foreach (var p in ShopPlatform.GetShopPlatforms())
|
|
|
|
|
- if (p == ShopPlatform.DefaultBlocks || p == ShopPlatform.DefaultWalls)
|
|
|
|
|
- foreach (var e in p.Entries)
|
|
|
|
|
- blocks.Add(e);
|
|
|
|
|
- else
|
|
|
|
|
- foreach (var e in p.Entries)
|
|
|
|
|
- objects.Add(e);
|
|
|
|
|
- for (int i = 0; i < System.Math.Min(objects.Count, 3); i++)
|
|
|
|
|
- {
|
|
|
|
|
- var entry = objects[i];
|
|
|
|
|
- var stand = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(-250f + 4 * i, -5.99f - 2 + 0.5f, 0.19f), Quaternion.identity, 0);
|
|
|
|
|
- stand.GetComponent<ScrapYardShopStandScript>().StartCallSet(entry.ItemID, entry.Price, entry.Quantity, entry.CurrencyItemID);
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ var stand = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(-250f + 4 * -5.5f, -5.99f - 2 + 0.5f, 0.19f), Quaternion.identity, 0);
|
|
|
|
|
+ stand.GetComponent<ScrapYardShopStandScript>().GetComponent<ScrapYardShopStandScript>().StartCallSet(ItemRegistry.GetItemIDByRegistryName("ScrapYard:Scrap Trophy"), 9999, 1, 57);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<ShopPlatformEntry> blocks = new List<ShopPlatformEntry>();
|
|
|
|
|
+ List<ShopPlatformEntry> objects = new List<ShopPlatformEntry>();
|
|
|
|
|
+ foreach (var p in ShopPlatform.GetShopPlatforms())
|
|
|
|
|
+ if (p == ShopPlatform.DefaultBlocks || p == ShopPlatform.DefaultWalls)
|
|
|
|
|
+ foreach (var e in p.Entries)
|
|
|
|
|
+ blocks.Add(e);
|
|
|
|
|
+ else
|
|
|
|
|
+ foreach (var e in p.Entries)
|
|
|
|
|
+ objects.Add(e);
|
|
|
|
|
+ for (int i = 0; i < System.Math.Min(objects.Count, 3); i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ var entry = objects[i];
|
|
|
|
|
+ var stand = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(-250f + 4 * i, -5.99f - 2 + 0.5f, 0.19f), Quaternion.identity, 0);
|
|
|
|
|
+ stand.GetComponent<ScrapYardShopStandScript>().StartCallSet(entry.ItemID, entry.Price, entry.Quantity, entry.CurrencyItemID);
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int i = 0; i < System.Math.Min(blocks.Count, 5); i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ var entry = blocks[i];
|
|
|
|
|
+ var stand = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(-250f + 4 * 7 + 4 * i, -5.99f + 6 + 0.5f, 0.19f), Quaternion.identity, 0);
|
|
|
|
|
+ stand.GetComponent<ScrapYardShopStandScript>().StartCallSet(entry.ItemID, entry.Price, entry.Quantity, entry.CurrencyItemID);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (objects.Count > 3 || blocks.Count > 5)
|
|
|
|
|
+ Core.logger.LogWarning("There are more stands than can be added to your ship. U should use the non Lite version of Scrap Yard");
|
|
|
}
|
|
}
|
|
|
- for (int i = 0; i < System.Math.Min(blocks.Count, 5); i++)
|
|
|
|
|
|
|
+ catch (System.Exception e)
|
|
|
{
|
|
{
|
|
|
- var entry = blocks[i];
|
|
|
|
|
- var stand = (GameObject)Network.Instantiate((GameObject)Resources.Load("prop/ScrapYard/stand"), new Vector3(-250f + 4 * 7 + 4 * i, -5.99f + 6 + 0.5f, 0.19f), Quaternion.identity, 0);
|
|
|
|
|
- stand.GetComponent<ScrapYardShopStandScript>().StartCallSet(entry.ItemID, entry.Price, entry.Quantity, entry.CurrencyItemID);
|
|
|
|
|
|
|
+ Core.logger.LogError(e);
|
|
|
}
|
|
}
|
|
|
- if (objects.Count > 3 || blocks.Count > 5)
|
|
|
|
|
- Core.logger.LogWarning("There are more stands than can be added to your ship. U should use the non Lite version of Scrap Yard");
|
|
|
|
|
- }
|
|
|
|
|
- catch (System.Exception e)
|
|
|
|
|
- {
|
|
|
|
|
- Core.logger.LogError(e);
|
|
|
|
|
}
|
|
}
|
|
|
yield break;
|
|
yield break;
|
|
|
}
|
|
}
|