示例#1
0
    public void setMenuContect(CoffeeInfo coffeeInfo)
    {
        this.gameObject.SetActive (true);

        TextLabel_Name.text = coffeeInfo.coffee_name;
        TextLabel_sourceLand.text = coffeeInfo.from;
        TextLabel_feature.text = coffeeInfo.feature;
        TextLabel_story.text = coffeeInfo.story;
        rawImg.texture = coffeeInfo.texture;
    }
示例#2
0
        static void Main(string[] args)
        {
            CaffeineBeverageInfo coffee = new CoffeeInfo();
            CaffeineBeverageInfo tea    = new TeaInfo();

            Console.WriteLine("--== Making coffee ==--");
            coffee.PrepareRecipe();
            Console.WriteLine();

            Console.WriteLine("--== Making tea ==--");
            tea.PrepareRecipe();

            Console.ReadLine();
        }
    void showCoffeeLog(CoffeeInfo coffee,int index)
    {
        Debug.Log(coffee.id);
        Debug.Log(coffee.coffee_name);
        Debug.Log(coffee.from);
        Debug.Log (coffee.story);
        Debug.Log (coffee.img);

        char[] seprator = {','};

        string[] base64String = coffee.img.Split (seprator, StringSplitOptions.None);

        byte[] b64_bytes = System.Convert.FromBase64String(base64String[1]);

        Texture2D tex = new Texture2D(1,1);
        tex.LoadImage (b64_bytes);

        coffee.texture = tex;

        CoffeeInfoList.Add(coffee);
    }
    public void CoffeeToJson()
    {
        coffee = new CoffeeInfo ();

        if (coffeeID == 1)
        {
            coffee.coffee_name = "Coffee 01";
            coffee.from = "coffee 01 Sourceland";
            coffee.feature = "coffee 01 Feature";
            coffee.story = "coffee 01 Story";
        }
        else
        {
            coffee.coffee_name = "Coffee 02";
            coffee.from = "coffee 02 Sourceland";
            coffee.feature = "coffee 02 Feature";
            coffee.story = "coffee 02 Story";
        }

        string json_coffee = JsonMapper.ToJson(coffee);

        Debug.Log(json_coffee);
    }