Example #1
0
    private void setAnimation(AnswerButtonHolder btn, int d)
    {
        RectTransform mRecttrans = btn.GetComponent <RectTransform>();

        Debug.Log("Setting Animation ==");
        mRecttrans.DOAnchorPosX(2550.0f, monkeySpeed[d]).SetEase(Ease.Linear);
    }
Example #2
0
    private void BurstBalloon(AnswerID balloonType, Vector3 ButtonPosition)
    {
        Debug.Log("BurstBalloon");

        LastClickedButton.gameObject.Hide();
        LastClickedButton = null;

//        GameObject g;
//
//        switch (balloonType)
//        {
//            case AnswerID.Balloon_Blue:
//                g = GameObject.Instantiate(Balloonburst_Blue, ButtonPosition, Quaternion.identity) as GameObject;
//                break;
//            case AnswerID.Balloon_Green:
//                g = GameObject.Instantiate(Balloonburst_Blue, ButtonPosition, Quaternion.identity) as GameObject;
//                break;
//            case AnswerID.Balloon_Yellow:
//                g = GameObject.Instantiate(Balloonburst_Blue, ButtonPosition, Quaternion.identity) as GameObject;
//                break;
//            case AnswerID.Balloon_Red:
//                g = GameObject.Instantiate(Balloonburst_Blue, ButtonPosition, Quaternion.identity) as GameObject;
//                break;
//        }
//
//        EProz.INSTANCE.WaitAndCall(1.5f, () =>
//            {
//                Destroy(g);
//            });
    }
    private void SetSize(AnswerButtonHolder mBtnHolder, QuestionUIInfo info, int index)
    {
        RectTransform rt = mBtnHolder.GetComponent <RectTransform>();

        Debug.Log("Index=" + index);
        //      defaultSize.Add(rt.sizeDelta);
        rt.sizeDelta *= info.QuestionData_Float[index];
    }
Example #4
0
    void InitMonkey()
    {
        randomPos     = new List <Vector2>();
        mAnswerHolder = monkey.GetComponent <AnswerButtonHolder>();
        MonkeyAnim    = monkey.GetChild(0).gameObject.GetComponent <Animator>();
        float width = GetComponent <RectTransform>().rect.width - shrink;

        for (int i = 0; i < 10; i++)
        {
            Vector2 vecPos = new Vector2(width * i / 9 + shrink * 0.5f, monkey.anchoredPosition.y);
            randomPos.Add(vecPos);
        }
        Clicked.onClick.AddListener(OnClicked);
        StartCoroutine(Monkey_Jump());
    }
Example #5
0
    private void SetSize(AnswerButtonHolder abh)
    {
//       / RectTransform rt = abh.GetComponent<RectTransform>();
        Transform rt = abh.gameObject.transform;

        defaultSize.Add(rt.localScale);

        Debug.Log(abh.ToString());

        switch (abh.mID)
        {
        case AnswerID.Big_MonkeySanta:
            rt.localScale *= 1.4f;
            break;

        case AnswerID.Medium_MonkeySanta:
            rt.localScale *= 1.2f;
            break;

        case AnswerID.Small_MonkeySanta:
            rt.localScale *= 1.0f;
            break;
        }
    }