Пример #1
0
        private void OnSwitch(bool up, Switchable source)
        {
            // We know these are 1-based
            if (int.TryParse(source.name, out int id))
            {
                if (!selectedSwitches.Contains(id))
                {
                    selectedSwitches.Add(id);
                }

                if (!up)
                {
                    if (id == correctFuseToSwitchOff)
                    {
                        spitznsparkz.SetActive(false);
                        Finish();
                    }
                }
                else if (id == 11 || id == 13)
                {
                    catastrophicFail = true;
                    spitznsparkz.SetActive(true);
                    LeanAudio.playClipAt(scream, spitznsparkz.transform.position);
                    Finish();
                }
            }
        }
Пример #2
0
        public void SetSwitch(bool up = true, Switchable source = null)
        {
            IsUp = up;

            ConnectedToCommon = up ? L1 : L2;
            NotifyOnSwitch?.Invoke(up, source);

            UpdateConnection(Circuit.TraceTrigger.Switch);
        }
Пример #3
0
        protected override void Awake()
        {
            base.Awake();

            switchable = GetComponent <Switchable>();
            if (switchable)
            {
                switchable.CallOnSwitchId = SetSwitch;
            }

            common.OnConnectionChanged = ConnectionChanged;
            L1.OnConnectionChanged     = ConnectionChanged;
            if (L2)
            {
                L2.OnConnectionChanged = ConnectionChanged;
            }

            SetSwitch();
        }
Пример #4
0
        private void Switched2(bool up, Switchable source)
        {
            switch2Test.actionPending = true;

            Debug.Log("Switched 2 to " + (up ? "up" : "down"));
        }