37 lines
749 B
C#
37 lines
749 B
C#
using System;
|
|
using FlaxEngine;
|
|
|
|
namespace Game;
|
|
|
|
public static class Utilities
|
|
{
|
|
public static ScopeProfiler ProfileScope(string eventName)
|
|
{
|
|
return new ScopeProfiler(eventName);
|
|
}
|
|
|
|
public class ScopeProfiler : IDisposable
|
|
{
|
|
public ScopeProfiler(string eventName)
|
|
{
|
|
Profiler.BeginEvent(eventName);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Profiler.EndEvent();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static class VectorExtensions
|
|
{
|
|
/*extension(Float3 value)
|
|
{
|
|
Float2 XY => new Float2(value.X, value.Y);
|
|
}*/
|
|
|
|
public static Float2 XY(this Float3 vec) => new Float2(vec.X, vec.Y);
|
|
|
|
public static Vector2 XY(this Vector3 vec) => new Vector2(vec.X, vec.Y);
|
|
} |