StrangeIOC: 在Start中初始化上下文报错Media

2018-10-27  本文已影响30人  RichMartin
    void Start () {
        this.context = new Demo1ContextView (this);
    }

在Start中初始化上下文报错
MediationException: A view was added with no context. Views must be added into the hierarchy of their ContextView lest all hell break loose.
Solved Way
MediationException: A view was added with no context. - Solved by adding the context in Awake and not Start.

    void Awake () {
        this.context = new Demo1ContextView (this);
    }

上一篇 下一篇

猜你喜欢

热点阅读