Example #1
0
        void Start()
        {
            //find player
            _player = GameObject.Find("player").GetComponent <PlayerColorData>();


            //init active tab
            _activeTab = _tabs[_tabCounter];
            _activeTab.transform.localScale = _upScale;
            _activeTab.Label.gameObject.SetActive(true);

            //find meters
            _r     = GameObject.Find("R").GetComponent <ColorMeter>();
            _g     = GameObject.Find("G").GetComponent <ColorMeter>();
            _b     = GameObject.Find("B").GetComponent <ColorMeter>();
            _frame = GameObject.Find("frame").GetComponent <MeterUI>();

            UpdateTabs();
        }
Example #2
0
        //go through the tabs after spinning
        public void UpdateWheel(int _dir)
        {
            //increase index and reset if necessary
            _tabCounter += _dir;
            if (_tabCounter == _tabs.Length)
            {
                _tabCounter = 0;
            }
            else if (_tabCounter == -1)
            {
                _tabCounter = _tabs.Length - 1;
            }

            //change scales
            _activeTab.transform.localScale = _normalScale;
            _activeTab.Label.gameObject.SetActive(false);

            //update active tab
            _activeTab = _tabs[_tabCounter];

            //change scales
            _activeTab.transform.localScale = _upScale;
            _activeTab.Label.gameObject.SetActive(true);
        }