This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DTO | |
{ | |
public static T GetClone<T>(this object donor) | |
{ | |
var type = typeof(T); | |
var target = Activator.CreateInstance(type); | |
var typeDonor = donor.GetType(); | |
var props = type.GetProperties(); | |
foreach (var prop in props) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class MoveInSquareShape: MonoBehaviour | |
{ | |
public float size = 1f; | |
public float rotation = 0f; | |
private void Update() | |
{ | |
transform.localPosition = Quaternion.Euler(0, 0, rotation) * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Sockets; | |
using System.Net; | |
using System.Text; | |
using System; | |
namespace WebTestServer | |
{ | |
public static class Program | |
{ | |
private static TcpClient client = new TcpClient(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
using UnityEngine.Serialization; | |
public class ThirdPersonCameraController : MonoBehaviour | |
{ | |
[SerializeField, FormerlySerializedAs("Camera Target")] private Transform target; | |
[Header("View")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class WeaponSway : MonoBehaviour | |
{ | |
[SerializeField] private Transform weaponTransform; | |
[Header("Sway Properties")] | |
[SerializeField] private float swaySmooth = 8f; | |
[SerializeField] private float swayDamp = 2f; | |
[SerializeField] private float posToRotAmount = 1f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CameraController : MonoBehaviour | |
{ | |
[SerializeField] private float _sensitivity = 3; | |
[SerializeField] private float _maxAngle = 80; | |
[SerializeField] private float _minAngle = -80; | |
[SerializeField] private Transform _horizontalRotation; | |
[SerializeField] private Transform _verticalRotation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class Multilerp | |
{ | |
public static Vector3 MultilerpFunction(Vector3[] points, float t) | |
{ | |
if (t >= 1) | |
{ | |
return points[points.Length - 1]; | |
} |
NewerOlder