Skip to content

Instantly share code, notes, and snippets.

View RevenantX's full-sized avatar

Ruslan Pyrch RevenantX

View GitHub Profile
public static class ArhiFastHasher
{
private static char[] Buffer = new char[1024];
public static ulong HashStr(string str)
{
str.CopyTo(0, Buffer, 0, str.Length);
ulong hash = 14695981039346656037UL; //offset
for (var i = 0; i < str.Length; i++)
public class AlmostFriendClass
{
interface INestedClass
{
void CallMethod(AlmostFriendClass afc);
}
public class NestedClass : INestedClass
{
using System;
using System.Collections.Generic;
namespace Game.Shared.Helpers
{
public class GamePool<T> where T : class
{
private readonly Stack<T> _pool;
private readonly Func<T> _creator;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Game.Shared.Helpers
{
public class FastList<T> : IList<T>
{
private T[] _items;
private int _count;
using System.Collections.Generic;
namespace Game.Shared.Helpers
{
public interface IStateMachineOwner
{
StateMachine StateMachine { get; }
}
public interface IState
interface IGameTask
{
void Execute();
}
class GameTaskManager : IDisposable
{
class TaskThread : IDisposable
{
private bool _isRunning;
using System;
using System.Collections.Generic;
namespace Game.Shared.Helpers
{
public class StateMachine<TStateEnum, TCommandEnum, TStateMachine>
where TStateEnum : struct, IComparable, IFormattable, IConvertible
where TCommandEnum : struct, IComparable, IFormattable, IConvertible
where TStateMachine : StateMachine<TStateEnum, TCommandEnum, TStateMachine>
{
@RevenantX
RevenantX / FindUsages.cs
Last active June 5, 2024 08:14
Find asset usages in prefabs and scenes (Unity3d)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
#if !UNITY
using System;
namespace UnityEngine
{
public struct Vector3
{
public float x;
public float y;
public float z;
using System;
using Game.Shared.MathHelpers;
using UnityEngine;
#if !UNITY
namespace UnityEngine
{
public struct Quaternion
{
public float x;