Пример #1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        //EnemyShip enemy = other.gameObject.GetComponent<EnemyShip>();
        //if (enemy != null)
        //{
        //    enemy.shootingEnabled = true;
        //}
        //else
        //{
        //    BossShip boss = other.gameObject.GetComponent<BossShip>();
        //    if (boss != null)
        //    {
        //        boss.shootingEnabled = true;
        //    }
        //}
        ISwitchable obj = other.gameObject.GetComponent <ISwitchable>();

        if (obj != null)
        {
            obj.SwitchOn();
        }

        //other.gameObject.GetComponent<EnemyShip>().shootingEnabled = true;
        //Debug.Log("коллизия!");
    }
Пример #2
0
 private void BtnCnCNetLobby_LeftClick(object sender, EventArgs e)
 {
     LastSwitchType = SwitchType.SECONDARY;
     primarySwitches[primarySwitches.Count - 1].SwitchOff();
     cncnetLobbySwitch.SwitchOn();
     privateMessageSwitch.SwitchOff();
 }
Пример #3
0
        private void BtnCnCNetLobby_LeftClick(object sender, EventArgs e)
        {
            LastSwitchType = SwitchType.SECONDARY;
            primarySwitches[primarySwitches.Count - 1].SwitchOff();
            cncnetLobbySwitch.SwitchOn();
            privateMessageSwitch.SwitchOff();

            // HACK warning
            // TODO: add a way for DarkeningPanel to skip transitions
            ((DarkeningPanel)((XNAControl)cncnetLobbySwitch).Parent).Alpha = 1.0f;
        }
Пример #4
0
        public void SwitchByUserInput()
        {
            var input = Console.ReadKey().Key;

            state = !state;

            while (input != ConsoleKey.Escape)
            {
                if (state)
                {
                    _myDevice.SwitchOn();
                }
                else
                {
                    _myDevice.SwitchOff();
                }

                input = Console.ReadKey().Key;
                state = !state;
            }
        }
Пример #5
0
 private void BtnPrivateMessages_LeftClick(object sender, EventArgs e)
 => privateMessageSwitch.SwitchOn();