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("коллизия!"); }
private void BtnCnCNetLobby_LeftClick(object sender, EventArgs e) { LastSwitchType = SwitchType.SECONDARY; primarySwitches[primarySwitches.Count - 1].SwitchOff(); cncnetLobbySwitch.SwitchOn(); privateMessageSwitch.SwitchOff(); }
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; }
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; } }
private void BtnPrivateMessages_LeftClick(object sender, EventArgs e) => privateMessageSwitch.SwitchOn();