ขึ้นอยู่กับ https://github.com/hiramtan/hiframework
การดาวน์โหลด
ใช้
var io = Center . Get < IIOComponent > ( ) ;
io . ReadFile ( "path" ) ; public override void Init ( )
{
base . Init ( ) ;
Bind < Example_Bind_ITest > ( ) . To < Example_Bind_ITestComponent > ( ) ;
} ตัวอย่างเพิ่มเติมอยู่ใน: ความสามัคคี/ทรัพย์สิน/ตัวอย่าง
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
}
เอกสารเก่า: (สำหรับเอกสารเพิ่มเติมดู Wiki: https://github.com/hiramtan/hiframework_unity/wiki):
คลิกลิงก์เพื่อเข้าร่วมกลุ่ม QQ [83596104]: https://jq.qq.com/?_wv=1027&k=5l6rzer
การสนับสนุน: [email protected]
ใบอนุญาต MIT
ลิขสิทธิ์ (c) [2017] [Hiram]
ได้รับอนุญาตโดยไม่ต้องเสียค่าใช้จ่ายสำหรับบุคคลใด ๆ ที่ได้รับสำเนาซอฟต์แวร์นี้และไฟล์เอกสารที่เกี่ยวข้อง ("ซอฟต์แวร์") เพื่อจัดการในซอฟต์แวร์โดยไม่มีข้อ จำกัด รวมถึง แต่ไม่ จำกัด เฉพาะสิทธิ์ในการใช้คัดลอกดัดแปลงผสานการเผยแพร่การจัดจำหน่าย
ประกาศลิขสิทธิ์ข้างต้นและประกาศการอนุญาตนี้จะรวมอยู่ในสำเนาทั้งหมดหรือส่วนสำคัญของซอฟต์แวร์
ซอฟต์แวร์มีให้ "ตามสภาพ" โดยไม่มีการรับประกันใด ๆ ไม่ว่าโดยชัดแจ้งหรือโดยนัยรวมถึง แต่ไม่ จำกัด เฉพาะการรับประกันความสามารถในการค้าการออกกำลังกายสำหรับวัตถุประสงค์เฉพาะและการไม่เข้าร่วม ไม่ว่าในกรณีใดผู้เขียนหรือผู้ถือลิขสิทธิ์จะต้องรับผิดชอบต่อการเรียกร้องความเสียหายหรือความรับผิดอื่น ๆ ไม่ว่าจะเป็นการกระทำของสัญญาการละเมิดหรืออื่น ๆ ที่เกิดขึ้นจากหรือเกี่ยวข้องกับซอฟต์แวร์หรือการใช้งานหรือการติดต่ออื่น ๆ ในซอฟต์แวร์