Пример #1
0
    // Update is called once per frame
    void Update()
    {
        HeartEffectGen heart    = HeartEffect.GetComponent <HeartEffectGen>();
        float          heartNum = heart.GetHeartCount();
        float          heartMax = heart.GetMaxHeartCount();

        slider.value = heartNum / heartMax;
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        // ハートの数が一定数超えない場合returnする
        HeartEffectGen heart = GameObject.Find("HeartEffectGenerator").GetComponent <HeartEffectGen>();

        if (heart.GetHeartCount() < heart.GetMaxHeartCount())
        {
            return;
        }


        float step = speed * Time.deltaTime;    // 回転する速さ(speedの値を変える)

        // maxActionCountまでフリフリしたら
        if (actionCount > maxActionCount)
        {
            // 元の位置に戻す
            this.transform.rotation = Quaternion.Slerp(this.transform.rotation, Quaternion.Euler(0.0f, 0.0f, 0.0f), step);
            if (this.transform.rotation.z * Mathf.Rad2Deg > -0.25f)
            {
                // 全ての値を戻す
                bAction     = false;
                bHurihuri   = false;
                actionCount = 0;
                heart.SetHeartCount(0);
                this.transform.rotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            }
        }
        else
        {
            bAction = true;
            if (!bHurihuri)   // 左にフリフリ
            {
                this.transform.rotation = Quaternion.Slerp(this.transform.rotation, Quaternion.Euler(0.0f, 0.0f, 5.0f), step);
                if (this.transform.rotation.z * Mathf.Rad2Deg > 2.4f)
                {
                    bHurihuri = true;
                    actionCount++;
                }
            }
            else   // 右にフリフリ
            {
                this.transform.rotation = Quaternion.Slerp(this.transform.rotation, Quaternion.Euler(0.0f, 0.0f, -5.0f), step);
                if (this.transform.rotation.z * Mathf.Rad2Deg < -2.4f)
                {
                    bHurihuri = false;
                    actionCount++;
                }
            }
        }
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        // ハートの数が一定数超えない場合returnする
        HeartEffectGen heart = GameObject.Find("HeartEffectGenerator").GetComponent <HeartEffectGen>();

        if (heart.GetHeartCount() > heart.GetMaxHeartCount())
        {
            OnePicture.SetActive(false);
            bGifPlaying = true;
            GifImage.Play();
        }
        else
        {
            OnePicture.SetActive(true);
        }
    }