new函数除了构建一个包括它的对象引用以外,基本上没什么作用。而且您可以看到,其它的函数在执行前必须先将那个空指针解开。
The new function basically does nothing besides building the object reference to contain that, and you can see that the other functions have to unpack the void pointer before getting down to business.
一个弱引用对象将会保持一个指向一个超出作用域或者被置空的对象的引用,直到它确实被垃圾回收删除。
A weak reference object will keep a reference to an object that went out of scope or was set to null, until it is actually deleted by the garbage collector.
创建一个名为“物理测试”的空游戏对象并添加“物理测试”脚本,并设置它的方块引用和初始速度。
Create an empty game object named PhysicsTest and add script PhysicsTest to it and set both, cube reference and initial velocity of it.
或者,引用类型变量可能不存放对任何对象的引用,这种情况称为空引用。
Or a reference type variable might not hold a reference to any object, in which case it is said to be a null reference or a reference to Nothing.
每个根或者引用托管堆中的对象,或者设置为空。
Each root either refers to an object on the managed heap or is set to null.
如果一个指针指向一个不在图中的对象,那么此对象就是一个不可到达的对象,垃圾收集器就将短弱引用表相应的槽置空。
If a pointer pointing to an object not in the graph, then the object is not a reachable object, and then garbage collector sets the slot to null in the short weak reference table.
如果一个指针指向一个不在图中的对象(注意此时图中已包含Finalize可到达的对象),那么此对象就是一个不可到达的对象,垃圾收集器就将长弱引用表相应的槽置空。
If a pointer pointing to an object not in the graph, then the object is not a reachable object, and then garbage collector sets the slot to null in the long weak reference table.
如果一个指针指向一个不在图中的对象(注意此时图中已包含Finalize可到达的对象),那么此对象就是一个不可到达的对象,垃圾收集器就将长弱引用表相应的槽置空。
If a pointer pointing to an object not in the graph, then the object is not a reachable object, and then garbage collector sets the slot to null in the long weak reference table.
应用推荐