Skip to content

Commit 06aec69

Browse files
committed
Add Readme in documentation folder
1 parent 45c2b62 commit 06aec69

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Unity Fast Tools
2+
**Unity Fast Tools** is a set of tools designed to minimize routine code writing in Unity.
3+
## Source Code
4+
### [[Aspid.UnityFastTools](https://github.com/VPDPersonal/Aspid.UnityFastTools)] [[Aspid.UnityFastTools.Generators](https://github.com/VPDPersonal/Aspid.UnityFastTools.Generators)]
5+
---
6+
## **Examples**
7+
``` csharp
8+
using UnityEngine;
9+
using Aspid.UnityFastTools;
10+
11+
public class MyBehaviour : MonoBehaviour
12+
{
13+
private void Update()
14+
{
15+
DoSomething1();
16+
DoSomething2();
17+
}
18+
19+
private void DoSomething1()
20+
{
21+
using var _ = this.Marker();
22+
// Some code
23+
}
24+
25+
private void DoSomething2()
26+
{
27+
using (this.Marker())
28+
{
29+
// Some code
30+
using var _ = this.Marker().WithName("Calculate");
31+
// Some code
32+
}
33+
}
34+
}
35+
```
36+
### Generated code
37+
``` csharp
38+
using System;
39+
using Unity.Profiling;
40+
using System.Runtime.CompilerServices;
41+
42+
internal static class __MyBehaviourProfilerMarkerExtensions
43+
{
44+
private static readonly ProfilerMarker DoSomething1_line_13 = new("MyBehaviour.DoSomething1 (13)");
45+
private static readonly ProfilerMarker DoSomething2_line_19 = new("MyBehaviour.DoSomething2 (19)");
46+
private static readonly ProfilerMarker DoSomething2_line_22 = new("MyBehaviour.Calculate (22)");
47+
48+
public static ProfilerMarker.AutoScope Marker(this MyBehaviour _, [CallerLineNumberAttribute] int line = -1)
49+
{
50+
if (line is 13) return DoSomething1_line_13.Auto();
51+
if (line is 19) return DoSomething2_line_19.Auto();
52+
if (line is 22) return DoSomething2_line_22.Auto();
53+
54+
throw new Exception();
55+
}
56+
}
57+
```
58+
59+
![Aspid.UnityFastTools.MarkerTest.png](Images/Aspid.UnityFastTools.MarkerTest.png)

Aspid.UnityFastTools/Assets/Plugins/Aspid/UnityFastTools/Documentation/README.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)