Skip to content

Instantly share code, notes, and snippets.

View talatari's full-sized avatar
🚀
Learn C# & Unity

Tsaplin Sergey talatari

🚀
Learn C# & Unity
View GitHub Profile
@talatari
talatari / HW41
Last active November 14, 2023 07:50 — forked from JUGADORUS/HW41
class Program
{
static void Main(string[] args)
{
DataBase dataBase = new DataBase();
dataBase.Work();
}
}
class Player
@talatari
talatari / PassengerTrainConfigurator.cs
Last active November 14, 2023 07:48 — forked from Avet1k/PassengerTrainConfigurator.cs
Passenger train configurator
namespace Junior;
class Program
{
static void Main(string[] args)
{
TrainConfigurator trainConfigurator = new TrainConfigurator();
trainConfigurator.Work();
}
}
using System;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
ClientsFactory factory = new ClientsFactory();
Supermarket supermarket = new Supermarket();
@talatari
talatari / Task 50: CarService
Last active January 17, 2024 10:27 — forked from adamkruver/Task 50: CarService
Task 50: CarService
namespace CarService
{
public static class Program
{
public static void Main()
{
PartFactory partFactory = new PartFactory();
CarFactory carFactory = new CarFactory(partFactory);
Queue<Car> cars = carFactory.CreateQueue();
CarService carService = new CarService(partFactory);
@talatari
talatari / InstantiateBulletsShooting.cs
Last active November 14, 2023 07:45 — forked from DmitriyProkopyev/BadExample.cs
Code Style Task. Проведите рефакторинг кода, исправьте все ошибки в именовании и форматировании так, чтобы не изменить принцип работы кода
using System.Collections;
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class InstantiateBulletsShooting : MonoBehaviour
{
[SerializeField] private float _multiplier;
[SerializeField] private Rigidbody _prefabBullet;
[SerializeField] private Transform _objectToShoot;
@talatari
talatari / FlyCamera.cs
Last active November 14, 2023 07:46 — forked from WISEPLAT/FlyCamera.cs
Unity Script to give camera WASD + mouse control
using UnityEngine;
public class FlyCamera : MonoBehaviour
{
private float _mainSpeed = 100.0f;
private float _shiftAdd = 250.0f;
private float _maxShift = 1000.0f;
private float _camSens = 0.25f;
private float _totalRun = 1.0f;
private Vector3 _lastMouse = new (255, 255, 255);
@talatari
talatari / BuildDisplayer.cs
Last active January 5, 2024 08:18 — forked from llamacademy/BuildDisplayer.cs
Build Incrementor Scripts from https://www.youtube.com/watch?v=PbFE0m9UMtE. If you get value from LlamAcademy, consider becoming a Patreon supporter at https://www.patreon.com/llamacademy
using UnityEngine;
using TMPro;
public class BuildDisplayer : MonoBehaviour
{
[SerializeField] private TMP_Text _textBuildNumber;
private void Awake()
{
if (_textBuildNumber.TryGetComponent(out TMP_Text textBuildLabel))
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PhysicsMovement : MonoBehaviour
{
public float MinGroundNormalY = .65f;
public float GravityModifier = 1f;
public Vector2 Velocity;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Random = System.Random;
// This source code is used for the video. It obviously requires heavy alterations to be used in a real project.
public class ExampleGrid : MonoBehaviour
{
[SerializeField] private Vector2Int _size;
[SerializeField] private Vector2 _gap;
@talatari
talatari / medium8-1-4.cs
Last active January 23, 2024 14:57 — forked from HolyMonkey/medium8-1-4.cs
20. Группировка полей по префиксу
class Player
{
private readonly Mover _mover;
private readonly Weapon _weapon;
public Player(Mover mover, Weapon weapon)
{
_mover = mover ?? throw new ArgumentNullException(nameof(mover));
_weapon = weapon ?? throw new ArgumentNullException(nameof(weapon));
}