Exemple #1
0
        override protected void Start()
        {
            base.Start();

            // Default to brush color controller.
            m_ColorController = App.BrushColor;

            // Walk upward and find the first ColorController relevant to us.
            for (var manager = m_Manager; manager != null; manager = manager.ParentManager)
            {
                ColorController controller = manager.GetComponent <ColorController>();
                if (controller != null)
                {
                    m_ColorController = controller;
                    break;
                }
            }
        }
Exemple #2
0
        override protected void Awake()
        {
            base.Awake();
            CustomColorPaletteStorage.m_Instance.ModeChanged += OnModeChanged;

            // Default to the brush color controller.
            m_ColorController = App.BrushColor;

            // Look for a different color controller on our manager.
            for (var manager = m_Manager; manager != null; manager = manager.ParentManager)
            {
                ColorController colorController = manager.GetComponent <ColorController>();
                if (colorController != null)
                {
                    m_ColorController = colorController;
                    break;
                }
            }
            m_ColorController.CurrentColorSet += OnCurrentColorSet;
        }