Skip to content

Instantly share code, notes, and snippets.

View gist:686e4778507b97d72eb1d55b59d286d2
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class Player : MonoBehaviour
{
[SerializeField] private int _maxHealth;
private int _health;
View gist:d1ad222d98012d3736adb7b431f59a64
public class Shotgun : Weapon
{
public override void Shoot(Transform[] shootPoints)
{
foreach (var shootPoint in shootPoints)
{
Instantiate(Bullet, shootPoint.position, Quaternion.identity);
}
}
}
View gist:08fe366b1e05421734ecc1c2c3e9bbca
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using UnityEngine.Events;
public class UI : MonoBehaviour
{
[SerializeField] private Button _attackButton;
View gist:ed2032def461973eeeba648ddd158172
private void Update()
{
Vector2 startCursorPosition = Vector2.zero;
if (Input.GetMouseButtonDown(0))
{
startCursorPosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
}
if (Input.GetMouseButton(0))
{
View gist:dc26bb670efc34f198db5c99d06a3150
class Program
{
static void Main(string[] args)
{
Soldier soldier1 = new Soldier("Богдан", "Лейтенант", "Автомат", 20);
Soldier soldier2 = new Soldier("Олег", "Полковник", "Ружье", 31);
Soldier soldier3 = new Soldier("Борис", "Капитан", "Пистолет", 33);
Soldier soldier4 = new Soldier("Олег", "Полковник", "Дробовик", 18);
View gist:96321b5bd722161a2ee7edf8f81d1bba
class Program
{
static void Main(string[] args)
{
Soldier soldier1 = new Soldier("Иван", "Лейтенант", "Автомат", 20);
Soldier soldier2 = new Soldier("Олег", "Полковник", "Ружье", 31);
Soldier soldier3 = new Soldier("Степан", "Рядовой", "Пистолет", 12);
Soldier soldier4 = new Soldier("Олег", "Ефрейтор", "Пистолет-пулемет", 12);
Soldier soldier5 = new Soldier("Андрей", "Капитан", "Пулемет", 25);
Soldier soldier6 = new Soldier("Егор", "Прапорщик", "Дробовик", 18);
View gist:8c2f4210c55a9f9a0acde1ee20e27b9d
class Program
{
static void Main(string[] args)
{
int currentYear = 2020;
Meat meat1 = new Meat("Микоян", 2008, 5);
Meat meat2 = new Meat("Мясофф", 2012, 10);
Meat meat3 = new Meat("Колбасы россии", 2016, 5);
Meat meat4 = new Meat("Мясной двор", 2003, 8);
View gist:a0eba49fd6afdf0bd507b7f566c5a936
class Program
{
static void Main(string[] args)
{
Player player1 = new Player("Олег", 18, 120);
Player player2 = new Player("Иван", 20, 80);
Player player3 = new Player("Петр", 32, 310);
Player player4 = new Player("Евгений", 12, 160);
Player player5 = new Player("Александр", 26, 111);
Player player6 = new Player("Алексей", 19, 99);
View gist:84466689bc024dd432fedfea6d659465
class Program
{
static void Main(string[] args)
{
bool isOpen = true;
string input;
string inputDisease;
Patient patient1 = new Patient("Олег", 18, "амнезия");
Patient patient2 = new Patient("Иван", 20, "перелом");
View gist:45a413739d2c6e9f7c59ed7527960fa6
class Program
{
static void Main(string[] args)
{
Criminal criminal1 = new Criminal("Дамский угодник", "Антиправительственное");
Criminal criminal2 = new Criminal("Карманник", "Убийство");
Criminal criminal3 = new Criminal("Форточник", "Воровство");
Criminal criminal4 = new Criminal("Серийный убийца", "Антиправительственное");
List<Criminal> criminals = new List<Criminal>() { criminal1, criminal2 , criminal3, criminal4 };