Exemple #1
0
 void Choice(TrashB.Choice choice)
 {
     if (choice == TrashB.Choice.LEFT)
     {
         trashImage.Throw(-1);
         leftBin.Shake(0.75f);
     }
     else
     {
         trashImage.Throw(1);
         rightBin.Shake(0.75f);
     }
     Finish(choice == trash.answer);
 }
Exemple #2
0
    public override void Init(Trash _trash)
    {
        trash = _trash as TrashA;

        currentStep = 1;

        nameText.text = trash.trashName;

        doneBtn.onClick.AddListener(() =>
        {
            if (lockChange)
            {
                return;
            }

            trashImage.Throw(0);
            bin.Shake(0.75f);
            Finish(currentStep == trash.targetStep);
        });
        RegisterButton(doneBtn);

        actionBtn.onClick.AddListener(() =>
        {
            ChangeState();
        });
        RegisterButton(actionBtn);

        trashImage = CreateTrashImage(trash.GetSprite(1));
    }