Esempio n. 1
0
 public override void CustomMethod()
 {
     if (GameObjectRef != null)
     {
         GameObjectRef.GetComponent <Mono_Toggle>().FlipSwitch(SwitchState[0]);
     }
 }
Esempio n. 2
0
        protected override void InternalUpdate(State[] oldState)
        {
            if (!Enumerable.SequenceEqual(oldState, PinState))
            {
                BitArray bitField = new BitArray(new bool[] {
                    PinState[0] == State.HIGH,
                    PinState[1] == State.HIGH,
                    PinState[3] == State.HIGH
                });

                int[] array = new int[1];
                bitField.CopyTo(array, 0);

                // float ts = 1.0f / ((((array[0]+0.0f) / 7.0f) * 29.0f) + 1.0f);
                float ts = 1.0f / (Mathf.Pow(2, array[0]));

                if (mono_Clock == null)
                {
                    mono_Clock = GameObjectRef.GetComponent <Mono_Clock>();
                }
                mono_Clock.StartClock(ts, this);
            }

            PinState[4] = On ? State.HIGH : State.LOW;
        }
Esempio n. 3
0
 public override void CustomMethod()
 {
     if (mono == null)
     {
         mono = GameObjectRef.GetComponent <Mono_Led>();
     }
     mono.ToggleLed(On);
 }
Esempio n. 4
0
 public override void CustomMethod()
 {
     if (GameObjectRef != null)
     {
         for (int i = 0; i < SwitchPins / 2; i++)
         {
             GameObjectRef.GetComponent <Mono_Dip>().FlipSwitch(i, SwitchState[i]);
         }
     }
 }
Esempio n. 5
0
 protected override void InternalReset(bool disable)
 {
     if (mono_Clock == null)
     {
         mono_Clock = GameObjectRef.GetComponent <Mono_Clock>();
     }
     mono_Clock.StopClock();
     PinState[4] = State.OFF;
     On          = false;
 }