Пример #1
0
        public void Add(NumberVariable v)
        {
            if (v is FloatVariable)
            {
                FloatVariable f = (FloatVariable)v;
                value += Mathf.RoundToInt(f.value);
            }

            if (v is IntVariable)
            {
                IntVariable i = (IntVariable)v;
                value += i.value;
            }

            gameEvent?.Invoke();
        }
Пример #2
0
        public void Remove(NumberVariable v)
        {
            if (v is FloatVariable)
            {
                FloatVariable f = (FloatVariable)v;
                value -= f.value;
            }

            if (v is IntVariable)
            {
                IntVariable i = (IntVariable)v;
                value -= i.value;
            }

            gameEvent?.Invoke();
        }