예제 #1
0
        public void SetOutValue(BlockBehaviour b, float v)
        {
            if (OutValue == v || v != 0 && Mathf.Approximately(OutValue, v))
            {
                return;
            }

            OutValue = v;
            bool needEmulate = OutValue > 0;

            if (needEmulate != IAmEmulating)
            {
                IAmEmulating = needEmulate;
                // emulate both key and message via dirty hack
                InputController.Emulate(b, new MKey[0], this, needEmulate);
                InvertUseMessage();
                InputController.Emulate(b, new MKey[0], this, needEmulate);
                RestoreSavedUseMessage();
            }
        }
예제 #2
0
        public void SetOutValue(BlockBehaviour b, float v)
        {
            if (OutValue == v || v != 0 && Mathf.Approximately(OutValue, v))
            {
                return;
            }

            OutValue = v;
            bool needEmulate = OutValue > 0;

            if (needEmulate != IAmEmulating)
            {
                IAmEmulating = needEmulate;
                InputController.Emulate(b, new MKey[0], this, needEmulate);
            }
        }