RunMixer()

Found in:

private void RunMixer(){
    Item newCreation = null;
    List ingr = new List();
    foreach(var ingredientSOt in ingredientSO){
      ingr.Add(ingredientSOt.itemName);
    }
    foreach(var potentialCreation in potentialCreations){
      List potent = new List();
      foreach(var poten in potentialCreation.items){
        potent.Add(poten.itemName);
      }
      if(Enumerable.SequenceEqual(ingr.OrderBy(e => e), potent.OrderBy(e => e))){
        newCreation = new Item{
          itemScriptableObject = potentialCreation.created,
          amount = potentialCreation.created.baseAmount
        };
        currentSpell = potentialCreation;
        changeSmokeGold();
        StartCoroutine(cleanUp(true, newCreation));
        break;
      }
    }


    if(newCreation == null){
      changeSmokeRed();
      StartCoroutine(cleanUp(false));
      //do some animation tht says these 2 things don't combine
    }
  }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *