public void OnEnable() { if (target == null) { return; } parallax = (UltimateParallax)target; if (parallax.layers == null) { parallax.layers = new List <Element>(); } }
static void AddParallaxToScene() { UltimateParallax _parallax = GameObject.FindObjectOfType <UltimateParallax>(); if (_parallax == null) { GameObject parallaxGO = new GameObject("Ultimate Parallax", typeof(UltimateParallax)); ShowNotification(parallaxGO.name + " added!"); Selection.activeTransform = parallaxGO.transform; } else { ShowNotification("Can't add more than one Ultimate Parallax!"); } }