Exemple #1
0
    /// <summary>
    /// エフェクト生成
    /// </summary>
    private void SpawnEffect()
    {
        if (isSpawn || !isMax)
        {
            return;
        }

        gameManager.SetTimeScale(100, 0.0f);
        maxBG.SetActive(true);
        FindObjectOfType <Canvas>().sortingLayerName = "Middle";

        spEffectObjcts.Add(Instantiate(spEffect));//エフェクト生成
        int num = spEffectObjcts.Count - 1;

        //生成位置設定(SPゲージの位置)
        Vector3 pos = FindObjectOfType <Camera>().ScreenToWorldPoint(transform.position);

        pos.y += 4;
        spEffectObjcts[num].transform.position = new Vector2(-pos.x, pos.y);

        //向かう座標を設定(プレイヤーの位置)
        SPEffect spEffect_class = spEffectObjcts[num].GetComponent <SPEffect>();

        spEffect_class.SetEndPoint(player.transform.position);

        //二つ目は左右反転させる
        if (num == 1)
        {
            spEffect_class.radius *= -1;
            //FindObjectOfType<GameManager>().Game(false);
            maxBG.SetActive(true);
            isSpawn = true;
        }
    }
Exemple #2
0
    /// <summary>
    /// スマシュポイントエフェクト生成
    /// </summary>
    private void SpawnSPEffect()
    {
        for (int i = 0; i < 2; i++)
        {
            GameObject effect = Instantiate(sp_effect);
            effect.transform.position = transform.position;

            GameObject smash = FindObjectOfType <SmashGage>().gameObject;
            Vector3    pos   = FindObjectOfType <Camera>().ScreenToWorldPoint(smash.transform.position);

            SPEffect effect_class = effect.GetComponent <SPEffect>();
            pos.y += 4;
            effect_class.SetEndPoint(new Vector2(-pos.x, pos.y));

            if (i == 1)
            {
                effect_class.radius *= -1;
            }
        }
    }