Example #1
0
        public virtual void OptionClick(GameObject obj)
        {
            ViewOption lastvop = null;

            if (Value >= 0 && Value < initgameobject.Count)
            {
                lastvop = initgameobject[Value].GetComponent <ViewOption>();
                lastvop.SetBackGroundColor(NoClickColor);
            }
            var vop = obj.GetComponent <ViewOption>();

            vop.SetBackGroundColor(ClickColor);
            Value = initgameobject.IndexOf(obj);
            if (OnValueChange != null)
            {
                OnValueChange(Value);
            }
        }
Example #2
0
        public virtual void OptionClick(int val)
        {
            ViewOption lastvop = null;

            if (Value >= 0 && Value < initgameobject.Count)
            {
                lastvop = initgameobject[Value].GetComponent <ViewOption>();
                lastvop.SetBackGroundColor(NoClickColor);
            }
            if (val >= 0 && val < options.Count)
            {
                var vop = initgameobject[val].GetComponent <ViewOption>();
                vop.SetBackGroundColor(ClickColor);
            }
            Value = val;
            if (OnValueChange != null)
            {
                OnValueChange(Value);
            }
        }