Esempio n. 1
0
    // Update is called once per frame
    public bool isCatIn()
    {
        if (InFlag)
        {
            FHP.MoveHPLight(-2f);
            BHP.MoveHPLight(-2f);
            CreentCatIn.transform.SetParent(canvas.transform, false);
            iTween.MoveAdd(CreentCatIn, iTween.Hash("y", -21, "time", 2.0f, "oncomplete", "OncompleteHandler", "oncompletetarget", gameObject));
            InFlag = false;
        }

        if (b_Flag && Input.GetButtonDown("GamePad1_buttonA"))
        {
            b_Flag          = false;
            CatInIkon.color = new Color(1, 1, 1, 0);
            FHP.MoveHPLight(0f);
            BHP.MoveHPLight(0f);
            iTween.MoveAdd(CreentCatIn, iTween.Hash("y", -80f, "time", 10.0f, "oncomplete", "NextCat", "oncompletetarget", CreentCatIn));
            i++;
            InFlag      = true;
            CreentCatIn = (GameObject)Instantiate(CatInPrefab[i]);

            foreach (Transform child in canvas.transform)
            {
                Destroy(child.gameObject);
            }

            return(true);
        }
        return(false);
    }