Berdasarkan https://github.com/hiramtan/hiframework
unduh
menggunakan
var io = Center . Get < IIOComponent > ( ) ;
io . ReadFile ( "path" ) ; public override void Init ( )
{
base . Init ( ) ;
Bind < Example_Bind_ITest > ( ) . To < Example_Bind_ITestComponent > ( ) ;
} Lebih banyak contoh di: Unity/Asset/Contoh
void Start ( )
{
Center . Init ( ) ;
new AsyncTaskWaitTime ( OnLog , 10 ) ;
}
// Update is called once per frame
void Update ( )
{
Center . Tick ( Time . deltaTime ) ;
}
void OnLog ( )
{
Debug . Log ( "wait for 10s" ) ;
} void Start ( )
{
Center . Init ( ) ;
var task = new AsyncTaskRepea ( OnLog , 2 ) ;
//task.Stop();
}
// Update is called once per frame
void Update ( )
{
Center . Tick ( Time . deltaTime ) ;
}
void OnLog ( )
{
Debug . Log ( "log every 2s" ) ;
} Center . Init ( ) ;
var eventComponent = Center . Get < IEventComponent > ( ) ;
eventComponent . Subscribe < int > ( "key" , OnEvent ) ;
eventComponent . Dispatch ( "key" , 100 ) ; Center . Init ( ) ;
var inject = Center . Get < IInjectComponent > ( ) ;
inject . Bind < Example_Inject > ( ) . To ( this ) ;
var newClass = new Example_Inject_NewClass ( ) ;
inject . Inject ( newClass ) ;
newClass . Log ( ) ; var signalComponent = Center . Get < ISignalComponent > ( ) ;
var signal = signalComponent . GetSignal < Example_Signal_Score > ( ) ;
signal . AddListener ( OnSignal ) ;
signal . Fire ( 100 ) ; - 对象池
```csharp
Center.Tick(Time.deltaTime);
_timeCounter += Time.deltaTime;
if (_timeCounter > _timeRate)
{
_timeCounter = 0;
var writer = _pool.GetOneObjectFromPool();
//let writer do something that cost time, will reuse this write when it finish task
}
Dokumentasi Lama: (Untuk lebih banyak dokumentasi, lihat wiki: https://github.com/hiramtan/hiframework_unity/wiki):
Klik tautan untuk bergabung dengan grup qq [83596104]: https://jq.qq.com/?_wv=1027&k=5l6rzer
Dukungan: [email protected]
Lisensi MIT
Hak Cipta (C) [2017] [Hiram]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restrictions, including without limitation the rights to use, copy, modify, merge, publish, distribution, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Pemberitahuan hak cipta di atas dan pemberitahuan izin ini harus dimasukkan dalam semua salinan atau bagian substansial dari perangkat lunak.
Perangkat lunak ini disediakan "sebagaimana adanya", tanpa jaminan apa pun, tersurat maupun tersirat, termasuk tetapi tidak terbatas pada jaminan dapat diperjualbelikan, kebugaran untuk tujuan tertentu dan nonpringement. Dalam hal apa pun penulis atau pemegang hak cipta tidak akan bertanggung jawab atas klaim, kerusakan atau tanggung jawab lainnya, baik dalam tindakan kontrak, gugatan atau sebaliknya, timbul dari, di luar atau sehubungan dengan perangkat lunak atau penggunaan atau transaksi lain dalam perangkat lunak.