mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
接入obfuz->2.0
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Obfuz
|
||||
{
|
||||
public class Pipeline
|
||||
{
|
||||
private readonly List<IObfuscationPass> _passes = new List<IObfuscationPass>();
|
||||
|
||||
public bool Empty => _passes.Count == 0;
|
||||
|
||||
public Pipeline AddPass(IObfuscationPass pass)
|
||||
{
|
||||
_passes.Add(pass);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
foreach (var pass in _passes)
|
||||
{
|
||||
pass.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
|
||||
foreach (var pass in _passes)
|
||||
{
|
||||
pass.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
var sw = new Stopwatch();
|
||||
foreach (var pass in _passes)
|
||||
{
|
||||
sw.Restart();
|
||||
pass.Process();
|
||||
sw.Stop();
|
||||
UnityEngine.Debug.Log($"Pass: {pass.GetType().Name} process cost time: {sw.ElapsedMilliseconds}ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user