粒子系统掉落

时间:2019-05-26 15:36:04

标签: unity3d

我用枪进行了fps,它具有用于射击的粒子系统。问题是效果成倍下降。我不知道是否可以通过效果检查器或生成弹丸的脚本来控制它

enter image description here

enter image description here enter image description here

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SpawnProjectiles : MonoBehaviour
{
    public GameObject firePoint;
    public List<GameObject> vfx = new List<GameObject>();
    private GameObject effectToSpawn;
    public Button button;

    // Start is called before the first frame update
    void Start()
    {
        effectToSpawn = vfx[0];
        button.onClick.AddListener(TaskOnClick);
    }

    // Update is called once per frame
    void Update()
    {
       
        
    }
    void SpawnVFX ()
    {
        GameObject vfx;
        if(firePoint != null)
        {
            vfx = Instantiate(effectToSpawn, firePoint.transform.position, Quaternion.identity); 


        }else
        {
            Debug.Log("NoFirePoint");
        }
    }
    void TaskOnClick()
    {

        SpawnVFX();


    }
}

0 个答案:

没有答案