void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "ItemA" && other.GetComponent <FruitController>().isSelected)
        {
            fruitAInside = true;
            chestControllerScript.SetToCapture(true);
        }

        if (other.tag == "ItemB" && other.GetComponent <FruitController>().isSelected)
        {
            fruitBInside = true;
            chestControllerScript.SetToCapture(true);
        }
    }
예제 #2
0
    public void InitializeExperiment(
        uint playerAFruits, uint playerBFruits, uint speedA, uint speedB, bool commonCounter
        )
    {
        cursorAScript.speed = (int)speedA;
        cursorBScript.speed = (int)speedB;

        boardManagerA.SetUpExperiment(10, 10, playerAFruits);
        boardManagerB.SetUpExperiment(10, 10, playerBFruits);

        chestAScript      = chestA.GetComponentInChildren <ChestController>();
        chestBScript      = chestB.GetComponentInChildren <ChestController>();
        chestCommonScript = chestCommon.GetComponentInChildren <CommonChestController>();
        chestCommonScript.actAsCounter = commonCounter;

        chestAScript.SetToCapture(false);
        chestBScript.SetToCapture(false);

        running = true;
    }