public void RemoveAndDestroy() { ParallaxControler controler = GetComponentInParent <ParallaxControler>(); controler.RemoveLayer(this); controler.ResetLayers(); DestroyImmediate(gameObject, true); }
public override void OnInspectorGUI() { DrawDefaultInspector(); ParallaxControler controler = (ParallaxControler)target; if (GUILayout.Button("ADD LAYER")) { controler.AddParallaxLayer(); } if (GUILayout.Button("REMOVE ALL LAYERS")) { controler.RemoveAllLayers(); } }