Пример #1
0
        public void SpawnLevelBlossoms()
        {
            SpawnedBlossoms.Clear();

            foreach (string blossom in ExistingBlossoms)
            {
                string blossomCurrentLevel = DialogueLua.GetVariable(blossom + "CurrentLevel").asString;
                // print(blossomCurrentLevel);
                float   blossomCurrentX = DialogueLua.GetVariable(blossom + "CurrentX").asFloat;
                float   blossomCurrentY = DialogueLua.GetVariable(blossom + "CurrentY").asFloat;
                Vector2 blossomPosition = new Vector2(blossomCurrentX, blossomCurrentY);
                if (SceneManager.GetActiveScene().name == blossomCurrentLevel)
                {
                    if (DialogueLua.GetVariable(blossom + "ForSale").asBool == true)
                    {
                        BlossomData newBlossom = Instantiate(BlossomStoreDummy, blossomPosition, transform.rotation);
                        newBlossom.GetComponent <BlossomDataSaver>().ApplyPersistentData(blossom);
                        SpawnedBlossoms.Add(blossom, newBlossom);
                    }
                    else
                    {
                        BlossomData newBlossom = Instantiate(BlossomPrefab, blossomPosition, transform.rotation);
                        newBlossom.GetComponent <BlossomDataSaver>().ApplyPersistentData(blossom);
                        SpawnedBlossoms.Add(blossom, newBlossom);
                    }
                }
            }
        }
Пример #2
0
        void NewDay(int pCurrentDay)
        {
            Data             = GetComponent <BlossomData>();
            Data.PetToday    = false;
            Data.TalkedToday = false;
            Data.FedToday    = false;
            if (Data.Growth != BlossomData.BlossomGrowth.Unborn)
            {
                Data.Age += 1;
                if (Data.Age >= 28 && (Data.Growth.ToString() != BlossomData.BlossomGrowth.Adult.ToString() && Data.Growth.ToString() != BlossomData.BlossomGrowth.Elder.ToString()))
                {
                    Data.Growth = BlossomData.BlossomGrowth.Adult;
                    print(Data.ID + "" + Data.Color);
                    GetComponent <BlossomAppearance>().SetAppearance(Data.Growth, Data.Color);
                }
                if (Data.Age >= 336 && (Data.Growth != BlossomData.BlossomGrowth.Elder))
                {
                    Data.Growth = BlossomData.BlossomGrowth.Elder;
                }
            }

            if (Data.Pregnant == true)
            {
                Data.DaysPregnant += 1;
            }

            SetDayEnergy();
            SetAffection();
            CheckPregnancy();
            CheckGiveBirth();
            Data.Happiness = 0;
            GetComponent <BlossomDataSaver>().OnRecordPersistentData();
        }
Пример #3
0
        public string CreateCompetitor(string pName, BlossomData.BlossomGrowth pGrowth, float pMinStrength, float pMaxStrength, float pMinAgility,
                                       float pMaxAgility, float pMinIntellect, float pMaxIntellect, float pMinCharm, float pMaxCharm, int pMinAffection = -1, int pMaxAffection = 1)
        {
            //CREATE BLOSSOM
            BlossomData newBlossom = Instantiate(BlossomPrefab, transform);

            newBlossom.ID = "Blossom" + CurrentBlossomID.ToString();
            string ID = newBlossom.ID;

            CurrentBlossomID += 1;
            //newBlossom.Age = pAge;
            newBlossom.Name    = pName;
            newBlossom.Parent1 = string.Empty;
            newBlossom.Parent2 = string.Empty;
            newBlossom.Growth  = pGrowth;
            newBlossom.Energy  = 2;

            //STATS
            //Agility
            newBlossom.Agility.Value = Random.Range(pMinAgility, pMaxAgility);

            //Strength
            newBlossom.Strength.Value = Random.Range(pMinStrength, pMaxStrength);

            //Intellect
            newBlossom.Intellect.Value = Random.Range(pMinIntellect, pMaxIntellect);

            //Charm
            newBlossom.Charm.Value = Random.Range(pMinCharm, pMaxCharm);

            newBlossom.CurrentLevel = string.Empty;

            newBlossom.transform.position = Vector2.zero;

            //ExistingBlossoms.Add(newBlossom.ID);

            BlossomColor[]           allColors = Resources.LoadAll <BlossomColor>("BlossomColors");
            Dictionary <string, int> colorPool = new Dictionary <string, int>();

            foreach (BlossomColor color in allColors)
            {
                colorPool.Add(color.Name, color.Probability);
            }
            newBlossom.Color = WeightedRandomizer.From(colorPool).TakeOne();


            if (pMinAffection != -1 && pMaxAffection != -1 && pMaxAffection >= pMinAffection)
            {
                int affection = Random.Range(pMinAffection, pMaxAffection);
                newBlossom.Affection = affection;
            }
            //DESTROY OBJECT, THIS WILL SAVE DATA
            Destroy(newBlossom.gameObject);
            return(ID);
        }
Пример #4
0
        void Start()
        {
            Data = GetComponent <BlossomData>();
            if (DialogueLua.DoesVariableExist(Data.ID + "HutX"))
            {
                Data.HutPosition = new Vector2(DialogueLua.GetVariable(Data.ID + "HutX").asFloat, DialogueLua.GetVariable(Data.ID + "HutY").asFloat);
                Data.HutName     = DialogueLua.GetVariable(Data.ID + "HutName").asString;
                Data.Hut         = BlossomManager.Instance.GetHutObject(Data.HutName);
            }


            GetComponent <BlossomAppearance>().SetAppearance(Data.Growth, Data.Color);
        }
Пример #5
0
        public void SpawnBlossom(string pBlossomID, Vector2 pPosition)
        {
            if (ExistingBlossoms.Contains(pBlossomID) == false)
            {
                return;
            }
            if (SpawnedBlossoms.ContainsKey(pBlossomID) == true)
            {
                DespawnBlossom(pBlossomID);
            }
            BlossomData newBlossom = Instantiate(BlossomPrefab, pPosition, transform.rotation);

            newBlossom.GetComponent <BlossomDataSaver>().ApplyPersistentData(pBlossomID);
            SpawnedBlossoms.Add(pBlossomID, newBlossom);
        }
        public void OnRecordPersistentData()
        {
            TargetData   = GetComponent <BlossomData>();
            VariableName = TargetData.ID;

            DialogueLua.SetVariable(VariableName + "ID", TargetData.ID);
            //STATS
            DialogueLua.SetVariable(VariableName + "AgilityValue", TargetData.Agility.Value);
            DialogueLua.SetVariable(VariableName + "AgilityPotential", TargetData.Agility.Potential);
            DialogueLua.SetVariable(VariableName + "AgilityLearningSpeed", TargetData.Agility.LearningSpeed);

            DialogueLua.SetVariable(VariableName + "StrengthValue", TargetData.Strength.Value);
            DialogueLua.SetVariable(VariableName + "StrengthPotential", TargetData.Strength.Potential);
            DialogueLua.SetVariable(VariableName + "StrengthLearningSpeed", TargetData.Strength.LearningSpeed);

            DialogueLua.SetVariable(VariableName + "IntellectValue", TargetData.Intellect.Value);
            DialogueLua.SetVariable(VariableName + "IntellectPotential", TargetData.Intellect.Potential);
            DialogueLua.SetVariable(VariableName + "IntellectLearningSpeed", TargetData.Intellect.LearningSpeed);

            DialogueLua.SetVariable(VariableName + "CharmValue", TargetData.Charm.Value);
            DialogueLua.SetVariable(VariableName + "CharmPotential", TargetData.Charm.Potential);
            DialogueLua.SetVariable(VariableName + "CharmLearningSpeed", TargetData.Charm.LearningSpeed);


            //FAMILY
            if (TargetData.Parent1 != string.Empty)
            {
                DialogueLua.SetVariable(VariableName + "Parent1", TargetData.Parent1);
            }
            if (TargetData.Parent2 != string.Empty)
            {
                DialogueLua.SetVariable(VariableName + "Parent2", TargetData.Parent2);
            }

            DialogueLua.SetVariable(VariableName + "ChildAmount", TargetData.Children.Count);
            int i = 0;

            foreach (string child in TargetData.Children)
            {
                DialogueLua.SetVariable(VariableName + "Child" + i, child);
                i++;
            }

            DialogueLua.SetVariable(VariableName + "Name", TargetData.Name);
            DialogueLua.SetVariable(VariableName + "Age", TargetData.Age);

            DialogueLua.SetVariable(VariableName + "Growth", TargetData.Growth.ToString());
            DialogueLua.SetVariable(VariableName + "Affection", TargetData.Affection);
            DialogueLua.SetVariable(VariableName + "Energy", TargetData.Energy);
            DialogueLua.SetVariable(VariableName + "Pregnant", TargetData.Pregnant);
            DialogueLua.SetVariable(VariableName + "DaysPregnant", TargetData.DaysPregnant);
            DialogueLua.SetVariable(VariableName + "BabyID", TargetData.BabyID);
            DialogueLua.SetVariable(VariableName + "PetToday", TargetData.PetToday);
            DialogueLua.SetVariable(VariableName + "TalkedToday", TargetData.TalkedToday);
            DialogueLua.SetVariable(VariableName + "FedToday", TargetData.FedToday);
            DialogueLua.SetVariable(VariableName + "Hungry", TargetData.Hungry);
            DialogueLua.SetVariable(VariableName + "Happiness", TargetData.Happiness);

            DialogueLua.SetVariable(VariableName + "TraitAmount", TargetData.Traits.Count);
            i = 0;
            foreach (Trait trait in TargetData.Traits)
            {
                DialogueLua.SetVariable(VariableName + "Trait" + i, trait.Name);
                i++;
            }

            DialogueLua.SetVariable(VariableName + "CurrentLevel", TargetData.CurrentLevel);
            DialogueLua.SetVariable(VariableName + "CurrentX", TargetData.transform.position.x);
            DialogueLua.SetVariable(VariableName + "CurrentY", TargetData.transform.position.y);

            DialogueLua.SetVariable(VariableName + "Color", TargetData.Color);

            DialogueLua.SetVariable(VariableName + "ForSale", TargetData.ForSale);
        }
 void Start()
 {
     TargetData   = GetComponent <BlossomData>();
     VariableName = TargetData.ID;
 }
        public void ApplyPersistentData(string pID = null)
        {
            if (pID == null)
            {
                return;
            }
            TargetData    = GetComponent <BlossomData>();
            VariableName  = pID;
            TargetData.ID = pID;
            //STATS
            TargetData.Agility.Value         = DialogueLua.GetVariable(VariableName + "AgilityValue").asFloat;
            TargetData.Agility.Potential     = DialogueLua.GetVariable(VariableName + "AgilityPotential").asFloat;
            TargetData.Agility.LearningSpeed = DialogueLua.GetVariable(VariableName + "AgilityLearningSpeed").asFloat;

            TargetData.Strength.Value         = DialogueLua.GetVariable(VariableName + "StrengthValue").asFloat;
            TargetData.Strength.Potential     = DialogueLua.GetVariable(VariableName + "StrengthPotential").asFloat;
            TargetData.Strength.LearningSpeed = DialogueLua.GetVariable(VariableName + "StrengthLearningSpeed").asFloat;

            TargetData.Intellect.Value         = DialogueLua.GetVariable(VariableName + "IntellectValue").asFloat;
            TargetData.Intellect.Potential     = DialogueLua.GetVariable(VariableName + "IntellectPotential").asFloat;
            TargetData.Intellect.LearningSpeed = DialogueLua.GetVariable(VariableName + "IntellectLearningSpeed").asFloat;

            TargetData.Charm.Value         = DialogueLua.GetVariable(VariableName + "CharmValue").asFloat;
            TargetData.Charm.Potential     = DialogueLua.GetVariable(VariableName + "CharmPotential").asFloat;
            TargetData.Charm.LearningSpeed = DialogueLua.GetVariable(VariableName + "CharmLearningSpeed").asFloat;


            //FAMILY
            if (DialogueLua.DoesVariableExist(VariableName + "Parent1"))
            {
                TargetData.Parent1 = DialogueLua.GetVariable(VariableName + "Parent1").asString;
            }
            if (DialogueLua.DoesVariableExist(VariableName + "Parent2"))
            {
                TargetData.Parent2 = DialogueLua.GetVariable(VariableName + "Parent2").asString;
            }

            TargetData.ChildAmount = DialogueLua.GetVariable(VariableName + "ChildAmount").asInt;
            TargetData.Children.Clear();
            for (int i = 0; i < TargetData.ChildAmount; i++)
            {
                TargetData.Children.Add(DialogueLua.GetVariable(VariableName + "Child" + i).asString);
            }

            TargetData.Name = DialogueLua.GetVariable(VariableName + "Name").asString;
            TargetData.Age  = DialogueLua.GetVariable(VariableName + "Age").asInt;

            BlossomData.BlossomGrowth growth = (BlossomData.BlossomGrowth)System.Enum.Parse(typeof(BlossomData.BlossomGrowth), DialogueLua.GetVariable(VariableName + "Growth").asString);
            TargetData.Growth = growth;

            TargetData.Affection    = DialogueLua.GetVariable(VariableName + "Affection").asInt;
            TargetData.Energy       = DialogueLua.GetVariable(VariableName + "Energy").asInt;
            TargetData.Pregnant     = DialogueLua.GetVariable(VariableName + "Pregnant").asBool;
            TargetData.DaysPregnant = DialogueLua.GetVariable(VariableName + "DaysPregnant").asInt;
            TargetData.BabyID       = DialogueLua.GetVariable(VariableName + "BabyID").asString;
            TargetData.PetToday     = DialogueLua.GetVariable(VariableName + "PetToday").asBool;
            TargetData.TalkedToday  = DialogueLua.GetVariable(VariableName + "TalkedToday").asBool;
            TargetData.FedToday     = DialogueLua.GetVariable(VariableName + "FedToday").asBool;
            TargetData.Hungry       = DialogueLua.GetVariable(VariableName + "Hungry").asBool;
            TargetData.Happiness    = DialogueLua.GetVariable(VariableName + "Happiness").asInt;



            TargetData.TraitAmount = DialogueLua.GetVariable(VariableName + "TraitAmount").asInt;
            TargetData.Traits.Clear();


            for (int i = 0; i < TargetData.TraitAmount; i++)
            {
                string traitName = DialogueLua.GetVariable(VariableName + "Trait" + i).asString;
                TargetData.Traits.Add(Resources.Load <Trait>("BlossomTraits/" + traitName));
            }

            TargetData.CurrentLevel = DialogueLua.GetVariable(VariableName + "CurrentLevel").asString;
            Vector2 newPos = new Vector2();

            newPos.x = DialogueLua.GetVariable(VariableName + "CurrentX").asFloat;
            newPos.y = DialogueLua.GetVariable(VariableName + "CurrentY").asFloat;
            TargetData.transform.position = newPos;

            if (GetComponent <Usable>() != null)
            {
                GetComponent <Usable>().overrideName = TargetData.Name;
            }
            gameObject.name = "Blossom " + TargetData.name;

            TargetData.Color = DialogueLua.GetVariable(VariableName + "Color").asString;

            TargetData.ForSale = DialogueLua.GetVariable(VariableName + "ForSale").asBool;

            if (DialogueLua.DoesVariableExist(VariableName + "Color"))
            {
                GetComponent <BlossomAppearance>().SetAppearance(TargetData.Growth, TargetData.Color);
            }


            if (DialogueLua.DoesVariableExist(VariableName + "HutName"))
            {
                TargetData.HutName     = DialogueLua.GetVariable(VariableName + "HutName").AsString;
                TargetData.HutPosition = new Vector2(DialogueLua.GetVariable(VariableName + "HutX").asFloat, DialogueLua.GetVariable(VariableName + "HutY").asFloat);
                TargetData.Hut         = BlossomManager.Instance.GetHutObject(TargetData.HutName);
            }
        }
Пример #9
0
        public string CreateRandomBlossom(string pName, BlossomData.BlossomGrowth pGrowth, float pPotentialMin, float pPotentialMax, float pSpeedMin, float pSpeedMax, int pAge, int pTraitMinAmount, int pTraitMaxAmount, string pCurrentLevel, Vector2 pCurrentPosition, bool pOwned = false)
        {
            //CREATE BLOSSOM
            BlossomData newBlossom = Instantiate(BlossomPrefab, transform);

            newBlossom.ID = "Blossom" + CurrentBlossomID.ToString();
            string ID = newBlossom.ID;

            CurrentBlossomID += 1;
            //newBlossom.Age = pAge;
            newBlossom.Name    = pName;
            newBlossom.Parent1 = string.Empty;
            newBlossom.Parent2 = string.Empty;
            newBlossom.Growth  = pGrowth;
            newBlossom.Energy  = 2;

            //STATS
            //Agility
            newBlossom.Agility.Value         = 0;
            newBlossom.Agility.Potential     = Random.Range(pPotentialMin, pPotentialMax);
            newBlossom.Agility.LearningSpeed = Random.Range(pSpeedMin, pSpeedMax);
            //Strength
            newBlossom.Strength.Value         = 0;
            newBlossom.Strength.Potential     = Random.Range(pPotentialMin, pPotentialMax);
            newBlossom.Strength.LearningSpeed = Random.Range(pSpeedMin, pSpeedMax);
            //Intellect
            newBlossom.Intellect.Value         = 0;
            newBlossom.Intellect.Potential     = Random.Range(pPotentialMin, pPotentialMax);
            newBlossom.Intellect.LearningSpeed = Random.Range(pSpeedMin, pSpeedMax);
            //Charm
            newBlossom.Charm.Value         = 0;
            newBlossom.Charm.Potential     = Random.Range(pPotentialMin, pPotentialMax);
            newBlossom.Charm.LearningSpeed = Random.Range(pSpeedMin, pSpeedMax);


            //TRAITS
            Trait[] allTraits = Resources.LoadAll <Trait>("BlossomTraits");
            Dictionary <Trait, int> traitPool = new Dictionary <Trait, int>();

            foreach (Trait trait in allTraits)
            {
                traitPool.Add(trait, trait.Probabilty);
            }
            int rand = Random.Range(pTraitMinAmount, pTraitMinAmount);

            for (int i = 0; i < rand; i++)
            {
                Trait trait = WeightedRandomizer.From(traitPool).TakeOne();
                if (!newBlossom.Traits.Contains(trait))
                {
                    newBlossom.Traits.Add(trait);
                }
            }

            newBlossom.CurrentLevel       = pCurrentLevel;
            newBlossom.transform.position = pCurrentPosition;

            if (pOwned == true)
            {
                OwnedBlossoms.Add(newBlossom.ID);
            }
            ExistingBlossoms.Add(newBlossom.ID);


            BlossomColor[]           allColors = Resources.LoadAll <BlossomColor>("BlossomColors");
            Dictionary <string, int> colorPool = new Dictionary <string, int>();

            foreach (BlossomColor color in allColors)
            {
                colorPool.Add(color.Name, color.Probability);
            }
            newBlossom.Color = WeightedRandomizer.From(colorPool).TakeOne();

            //DESTROY OBJECT
            Destroy(newBlossom.gameObject);
            return(ID);
        }
Пример #10
0
        public string CreateChildBlossom(string pParent1, string pParent2)
        {
            //CREATE BLOSSOM

            BlossomData newBlossom = Instantiate(BlossomPrefab, transform);

            newBlossom.ID = "Blossom" + CurrentBlossomID.ToString();
            string ID = newBlossom.ID;

            CurrentBlossomID += 1;
            newBlossom.Age    = 0;
            newBlossom.Name   = GetRandomBlossomName();



            newBlossom.Parent1 = pParent1;
            newBlossom.Parent2 = pParent2;

            newBlossom.Energy = 2;

            //STATS
            //Agility
            newBlossom.Agility.Value         = 0;
            newBlossom.Agility.Potential     = SetChildStat(pParent1, pParent2, "AgilityPotential");
            newBlossom.Agility.LearningSpeed = SetChildStat(pParent1, pParent2, "AgilityLearningSpeed");
            //Strength
            newBlossom.Strength.Value         = 0;
            newBlossom.Strength.Potential     = SetChildStat(pParent1, pParent2, "StrengthPotential");
            newBlossom.Strength.LearningSpeed = SetChildStat(pParent1, pParent2, "StrengthLearningSpeed");
            //Intellect
            newBlossom.Intellect.Value         = 0;
            newBlossom.Intellect.Potential     = SetChildStat(pParent1, pParent2, "IntellectPotential");
            newBlossom.Intellect.LearningSpeed = SetChildStat(pParent1, pParent2, "IntellectLearningSpeed");
            //Charm
            newBlossom.Charm.Value         = 0;
            newBlossom.Charm.Potential     = SetChildStat(pParent1, pParent2, "CharmPotential");
            newBlossom.Charm.LearningSpeed = SetChildStat(pParent1, pParent2, "CharmLearningSpeed");


            //TRAITS
            string dominantParent;
            int    rand = Random.Range(0, 100);

            if (rand <= 50)
            {
                dominantParent = pParent2;
            }
            else
            {
                dominantParent = pParent1;
            }
            Dictionary <Trait, int> parentTraits = new Dictionary <Trait, int>();

            List <Trait> parent1Traits      = new List <Trait>();
            int          parent1TraitAmount = DialogueLua.GetVariable(pParent1 + "TraitAmount").asInt;

            for (int i = 0; i < parent1TraitAmount; i++)
            {
                string traitName = DialogueLua.GetVariable(pParent1 + "Trait" + i).asString;
                parent1Traits.Add(Resources.Load <Trait>("BlossomTraits/" + traitName));
            }

            List <Trait> parent2Traits      = new List <Trait>();
            int          parent2TraitAmount = DialogueLua.GetVariable(pParent2 + "TraitAmount").asInt;

            for (int i = 0; i < parent1TraitAmount; i++)
            {
                string traitName = DialogueLua.GetVariable(pParent2 + "Trait" + i).asString;
                parent1Traits.Add(Resources.Load <Trait>("BlossomTraits/" + traitName));
            }

            List <Trait> dominantTraits    = new List <Trait>();
            List <Trait> nonDominantTraits = new List <Trait>();

            if (dominantParent == pParent1)
            {
                dominantTraits    = parent1Traits;
                nonDominantTraits = parent2Traits;
            }
            else
            {
                dominantTraits    = parent2Traits;
                nonDominantTraits = parent1Traits;
            }

            foreach (Trait trait in dominantTraits)
            {
                if (!parentTraits.ContainsKey(trait))
                {
                    parentTraits.Add(trait, trait.Probabilty * 2);
                }
            }

            foreach (Trait trait in nonDominantTraits)
            {
                if (!parentTraits.ContainsKey(trait))
                {
                    parentTraits.Add(trait, trait.Probabilty);
                }
                else
                {
                    parentTraits[trait] += trait.Probabilty;
                }
            }

            rand = Random.Range(1, 2);
            for (int i = 0; i < rand; i++)
            {
                Trait trait = WeightedRandomizer.From(parentTraits).TakeOne();
                if (!newBlossom.Traits.Contains(trait))
                {
                    newBlossom.Traits.Add(trait);
                }
            }



            //STAT POTENTIAL BONUS DISTRIBUTION
            for (int potentialBonus = 10; potentialBonus > 0; potentialBonus--)
            {
                List <string> availableStats = new List <string>();
                availableStats.Add("AgilityPotential");
                availableStats.Add("StrengthPotential");
                availableStats.Add("IntellectPotential");
                availableStats.Add("CharmPotential");

                if (availableStats.Count > 0)
                {
                    rand = Random.Range(0, availableStats.Count);
                    float currentVal = DialogueLua.GetVariable(newBlossom + availableStats[rand]).asFloat;
                    DialogueLua.SetVariable(newBlossom + availableStats[rand], currentVal + 1);
                }
                else
                {
                    break;
                }
            }

            //STAT LEARNING SPEED BONUS DISTRIBUTION
            for (int learningSpeedBonus = 2; learningSpeedBonus > 0; learningSpeedBonus--)
            {
                List <string> availableStats = new List <string>();

                availableStats.Add("AgilityLearningSpeed");
                availableStats.Add("StrengthLearningSpeed");
                availableStats.Add("IntellectLearningSpeed");
                availableStats.Add("CharmLearningSpeed");

                if (availableStats.Count > 0)
                {
                    rand = Random.Range(0, availableStats.Count);
                    float currentVal = DialogueLua.GetVariable(newBlossom + availableStats[rand]).asFloat;
                    DialogueLua.SetVariable(newBlossom + availableStats[rand], currentVal + 0.1f);
                }
                else
                {
                    break;
                }
            }


            string parent1Color = DialogueLua.GetVariable(pParent1 + "Color").asString;
            string parent2Color = DialogueLua.GetVariable(pParent2 + "Color").asString;

            BlossomColorMix[] allMixes    = Resources.LoadAll <BlossomColorMix>("BlossomColorMixes");
            BlossomColorMix   matchingMix = null;

            foreach (BlossomColorMix mix in allMixes)
            {
                if ((mix.Input1.Name == parent1Color && mix.Input2.Name == parent2Color) || (mix.Input1.Name == parent2Color && mix.Input2.Name == parent1Color))
                {
                    matchingMix = mix;
                }
            }
            if (matchingMix != null)
            {
                Dictionary <string, int> outputs = new Dictionary <string, int>();
                foreach (ColorOutput output in matchingMix.Outputs)
                {
                    outputs.Add(output.Output.Name, output.Output.Probability);
                }
                string color = WeightedRandomizer.From(outputs).TakeOne();
                newBlossom.Color = color;
            }
            else
            {
                Dictionary <string, int> parentColors = new Dictionary <string, int>();
                BlossomColor             color1       = Resources.Load <BlossomColor>("BlossomColors/" + parent1Color);
                BlossomColor             color2       = Resources.Load <BlossomColor>("BlossomColors/" + parent2Color);

                parentColors.Add(color1.Name, color1.Probability);
                if (!parentColors.ContainsKey(color2.Name))
                {
                    parentColors.Add(color2.Name, color2.Probability);
                }
                string color = WeightedRandomizer.From(parentColors).TakeOne();
                newBlossom.Color = color;
            }


            //DESTROY OBJECT
            Destroy(newBlossom.gameObject);
            return(ID);
        }