// tạo FX chớp chớp, mờ,... lên 1 đối tượng nào đó
    public void ApplyEffect(TYPE_FX type, GameObject target)
    {
        temp = Instantiate(prefabs[(int)type]) as GameObject;

        // !!! lưu ý không gọi cartoon FX
        temp.GetComponent <BaseEffect>().Init(target);
    }
 // Spawn ra tại location đó
 public void Spawn(TYPE_FX type, Vector3 location)
 {
     temp = Instantiate(prefabs[(int)type]) as GameObject;
     temp.transform.position = location;
 }
 // dùng spawn mấy cái fx ko cần location
 public void Spawn(TYPE_FX type)
 {
     Instantiate(prefabs[(int)type]);
 }
Exemplo n.º 4
0
 public void Spawn(TYPE_FX type, Vector3 location)
 {
     Instantiate(prefabs[(int)type], location, Quaternion.identity);
 }