public bool active;
public Toggle onofftoggle;
public GameObject[] camera;
PixelShader ps;
void Start ()
{
ps = camera.GetComponent<PixelShader> ();
}
void Update ()
{
if (active)
{
camera = GameObject.FindGameObjectsWithTag ("MainCamera");
}
}
public void PixelezationMode ()
{
if (onofftoggle == true)
{
ps.enabled = true;
}
if (onofftoggle == false)
{
ps.enabled = false;
}
}
пишет "Assets/Skripts/Setting/onoffpixeleffext.cs(15,15): error CS1061: Type `UnityEngine.GameObject[]' does not contain a definition for `GetComponent' and no extension method `GetComponent' of type `UnityEngine.GameObject[]' could be found. Are you missing an assembly reference?"
как можно выключить на мульти обьекте скрипт?