public static void AddSeeds(Seeds seed) { bool added = false; for (int i = 0; i < instance.seedBag.Length; i++) { if (instance.seedBag[i] != null) { if (instance.seedBag[i].SameGenes(seed.GetPlantGenes())) { instance.seedBag[i].amount += seed.amount; instance.UpdateSeeds(); added = true; break; } } } for (int i = 0; i < instance.seedBag.Length; i++) { if (!added) { if (instance.seedBag[i] == null) { instance.seedBag[i] = new Seeds(seed.GetPlantGenes().GetAllGenes().ToArray()); instance.UpdateSeeds(); break; } } } }
public void SelectingSeed(int selection) { if (seedBag[selection + seedBase] != null) { selectedSeed = seedBag[selection + seedBase]; Cursor.SetCursor(selectedSeed.GetPlantGenes().GetRandomGene(0).GetSeedCursor(), Vector2.zero, CursorMode.Auto); selectedSeedPos = selection + seedBase; } }
public void SelectingSeed(int selection) { if (seedBag[selection + seedBase] != null && HoldingObjectManager.Instance().GrabingSomething(HoldingObjectManager.ObjectInHands.Seed)) { selectedSeed = seedBag[selection + seedBase]; Cursor.SetCursor(selectedSeed.GetPlantGenes().GetRandomGene(0).GetSeedCursor(), Vector2.zero, CursorMode.Auto); selectedSeedPos = selection + seedBase; } }