SpriteAtlasManager
Namespace: UnityEngine.U2D
Description:
In the run-time managementSpriteAtlas
may not be referenced in any Sprite Atlas
load in the case Sprite
, such a result is no texture. In the user by listening to SpriteAtlasManager.atlasRequested
the atlas to register a callback Sprite
before, it is not visible. When triggered, it will pass atlas tag
and System.Action
it will receive a atlas object.
Event:
| Event | Description |
| - | - |
| | atlasRegistered triggered SpriteAtlasManager.atlasRequested callback call to register SpriteAtlas |
| atlasRequested | triggered when any Sprite bound to SpriteAtlas but can not be found at runtime atlas asset. |
Details found when:
altasRequested
in Start
after a call that in the coming time display atlasRegistered
is in altasRequested
the use of callback calls.
altasRequested
Even the elves binding sprite atlas
already exists, or will trigger the event.
Also found a Unitybug, ??
the operator has a bug in the version 2018.4.8
public class Test : MonoBehaviour
{
public Text Text; // text已序列化
public Font Font;// null
void Start()
{
Text.font = Font == null ? Text.font : Font; // 正确.text.font 没改变
//Text.font = Font ?? Text.font; // 错误.text.font会变成null,但这个写法是上面的简化版本
}
// Update is called once per frame
void Update()
{
}
}
During this time, has been busy, not much time to write a blog to learn things, constantly struggling in the whirlpool of life, I do not know whether this will really change anything ...