Example #1
0
  public void ButtonPressed(Button button)
  {
      option = button.name;
      Debug.Log(option);

      switch (option)
      {
      case ("Beach"):
          requirements.Location = 1;
          break;

      case ("Venue"):
          requirements.Location = 2;
          break;

      case ("Office"):
          requirements.Location = 3;
          break;

      case ("House"):
          requirements.Location = 4;
          break;

      case ("Woman"):
          requirements.Woman = true;
          break;

      case ("Man"):
          requirements.Woman = false;
          break;

      case ("Formal"):
          requirements.Formal = true;
          break;

      case ("Informal"):
          requirements.Formal = false;
          break;

      case ("Create"):
          ClothesFactory factory = new ClothesFactory(requirements);
          IClothes       v       = factory.Create();
          createPressed(v);
          break;

      default:
          requirements.Location = 2;
          requirements.Woman    = true;
          requirements.Formal   = false;
          break;
      }

      //return 0;
  }
Example #2
0
    void Start()
    {
        ClothesRequirements requirements = new ClothesRequirements();

        requirements.Woman    = Woman;
        requirements.Location = Mathf.Max(Location);
        requirements.Woman    = Formal;
        requirements.Formal   = Formal;

        ClothesFactory factory = new ClothesFactory(requirements);
        IClothes       v       = factory.Create();

        Debug.Log(v);
    }