2024年3月9日发(作者:)
64
65 public static void QueueOnMainThread(Action
66 {
67 QueueOnMainThread(taction, tparam, 0f);
68 }
69 public static void QueueOnMainThread(Action
70 {
71 if (time != 0)
72 {
73 lock (Current._delayed)
74 {
75 Current._(new DelayedQueueItem { time = + time, action = taction, param = tparam });
76 }
77 }
78 else
79 {
80 lock (Current._actions)
81 {
82 Current._(new NoDelayedQueueItem { action = taction, param = tparam });
83 }
84 }
85 }
86
87 public static Thread RunAsync(Action a)
88 {
89 Initialize();
90 while (numThreads >= maxThreads)
91 {
92 (100);
93 }
94 ent(ref numThreads);
95 serWorkItem(RunAction, a);
96 return null;
97 }
98
99 private static void RunAction(object action)
100 {
101 try
102 {
103 ((Action)action)();
104 }
105 catch
106 {
107 }
108 finally
109 {
110 ent(ref numThreads);
111 }
112
113 }
114
115
116 void OnDisable()
117 {
118 if (_current == this)
119 {
120
121 _current = null;
122 }
123 }
124
125
126
127 // Use this for initialization
128 void Start()
129 {
130
131 }
132
133 List
134
135 // Update is called once per frame
136 void Update()
137 {
138 if (_ > 0)
139 {
140 lock (_actions)
141 {
142 _();
143 _ge(_actions);
144 _();
145 }
146 for (int i = 0; i < _; i++)
147 {


发布评论