コード例 #1
0
        void Start()
        {
            gameManager  = GameObject.Find("Dummy").GetComponent <GameManager>();
            liquidSpamer = GameObject.Find("Liquid Spamer").GetComponent <ParticleSystem>();
            arrow        = GameObject.Find("Pivot").GetComponent <Animator>();
            pouringSound = GameObject.Find("Pouring Sound").GetComponent <AudioSource>();
            sellingSound = GameObject.Find("Purchase Sound").GetComponent <AudioSource>();

            arrow.SetBool(LiquidPouring, false);

            coffeeSold   = new UnityEvent();
            pouringSpeed = gameManager.difficulty;

            liquidOrder = 0;

            var randIndex = Random.Range(0, Recipes.Length);

            chosenRecipe = Recipes[randIndex];

            liquidsAmount = chosenRecipe.liquids.Length;
            pouredLiquids = new List <GameObject>();
            lines         = new GameObject[liquidsAmount];

            if (!mugOnPlace)
            {
                StartCoroutine(MoveMug(Destination));
            }

            EnableLines();
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: AlexandRLV/MyHomeWork
        public void TestMethod1()
        {
            Components c = new CoffeeComponent();

            c.ReadComponents("Components.txt");
            Recipe r = new CoffeeRecipe("A", 20);

            r.AddComponent("Water", 10000);
            Recipe r2 = new CoffeeRecipe("A", 20);

            r2.AddComponent("Water", 10);
            r2.AddComponent("Coffee", 10);
            bool b  = c.CheckRecipe(r);
            bool b2 = c.CheckRecipe(r2);

            Assert.AreEqual(b, false);
            Assert.AreEqual(b2, true);
        }