Esempio n. 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();
        }
        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();
        }