示例#1
0
 private void OnTriggerStay2D(Collider2D other)
 {
     if (canCollect == true && other.gameObject.tag == "coin")
     {
         instantiateCoin.destroyCoin();
         instantiateCoin.setCanInstantiate(true);
         main.setCoins();
         isSuccessed = true;
     }
 }
示例#2
0
    IEnumerator InviseCoin(float time, float waitTime)
    {
        yield return(new WaitForSeconds(time));

        for (int i = 0; i < 3; i++)
        {
            objRenderer.color = new Color(objRenderer.color.r, objRenderer.color.g, objRenderer.color.b, 0f);
            yield return(new WaitForSeconds(waitTime));

            objRenderer.color = new Color(objRenderer.color.r, objRenderer.color.g, objRenderer.color.b, 1f);
            yield return(new WaitForSeconds(waitTime));
        }

        InstantiateCoin instantiate = gameObject.GetComponentInParent <InstantiateCoin>();

        instantiate.setCanInstantiate(true);
        instantiate.GetComponentInParent <InstantiateCoin>().instantiateCoin();
        instantiate.GetComponentInParent <InstantiateCoin>().addAttempts();
        instantiate.setStage();
        instantiate.destroyCoin();
    }
示例#3
0
    public void setStage(bool isClick)
    {
        if (stage == 3 && !isClick)
        {
            stage = 1;
            if (ball.getSuccessed() == false)
            {
                instantiateCoin.destroyCoin();
            }

            instantiateCoin.instantiateCoin();
            instantiateCoin.setCanInstantiate(false);

            horizontalSlider.transform.position = new Vector3(horizontalPoints[0].position.x, horizontalPoints[0].position.y, horizontalSlider.transform.position.z);
            verticalSlider.transform.position   = new Vector3(vertcalPoints[0].position.x, vertcalPoints[0].position.y, verticalSlider.transform.position.z);
        }
        if (stage != 3 && isClick)
        {
            stage++;
        }
    }