Unity Manual SpriteAtlasManager translation

SpriteAtlasManager

Namespace: UnityEngine.U2D

Description:
In the run-time managementSpriteAtlas
may not be referenced in any Sprite Atlasload in the case Sprite, such a result is no texture. In the user by listening to SpriteAtlasManager.atlasRequestedthe atlas to register a callback Spritebefore, it is not visible. When triggered, it will pass atlas tagand System.Actionit 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:
altasRequestedin Startafter a call that in the coming time display atlasRegisteredis in altasRequestedthe use of callback calls.

altasRequestedEven the elves binding sprite atlasalready 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 ...

Guess you like

Origin www.cnblogs.com/Fallever/p/11482848.html