示例#1
0
    public void OnEnable()
    {
        if (target == null)
        {
            return;
        }
        parallax = (UltimateParallax)target;

        if (parallax.layers == null)
        {
            parallax.layers = new List <Element>();
        }
    }
示例#2
0
    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!");
        }
    }