Пример #1
0
    public override void Init(Trash _trash)
    {
        trash = _trash as TrashC;

        nameText.text = trash.trashName;

        stopBtn.onClick.AddListener(() =>
        {
            trashImageAnimator.SetBool("Stop", true);
            handAnimator.SetBool("Stop", true);

            if (throwCoroutine != null)
            {
                StopCoroutine(throwCoroutine);
                throwCoroutine = null;
            }

            Finish(!trash.throwingIsAnswer);
        });
        RegisterButton(stopBtn);

        trashImage.sprite = trash.image;

        bin.Set(trash.typeBottom);

        throwCoroutine = StartCoroutine(Throw());

        //Vector2 handSize = handImage.rectTransform.sizeDelta;
        //handSize = new Vector2(Mathf.Lerp(500f, 850f, trash.handDepth), handSize.y);
        //handImage.rectTransform.sizeDelta = handSize;
    }
Пример #2
0
    public override void Init(Trash _trash)
    {
        trash = _trash as TrashB;

        nameText.text = trash.trashName;

        leftBtn.onClick.AddListener(() =>
        {
            Choice(TrashB.Choice.LEFT);
        });
        leftBtn.GetComponentInChildren <Text>().text = trash.typeLeft.typeName;
        RegisterButton(leftBtn);

        rightBtn.onClick.AddListener(() =>
        {
            Choice(TrashB.Choice.RIGHT);
        });
        rightBtn.GetComponentInChildren <Text>().text = trash.typeRight.typeName;
        RegisterButton(rightBtn);

        trashImage = CreateTrashImage(trash.image);

        leftBin.Set(trash.typeLeft);
        rightBin.Set(trash.typeRight);
    }