public void RemoveAndDestroy()
    {
        ParallaxControler controler = GetComponentInParent <ParallaxControler>();

        controler.RemoveLayer(this);
        controler.ResetLayers();

        DestroyImmediate(gameObject, true);
    }
Ejemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        ParallaxControler controler = (ParallaxControler)target;

        if (GUILayout.Button("ADD LAYER"))
        {
            controler.AddParallaxLayer();
        }

        if (GUILayout.Button("REMOVE ALL LAYERS"))
        {
            controler.RemoveAllLayers();
        }
    }