当前位置:网站首页>Setting overridesorting for canvas does not take effect
Setting overridesorting for canvas does not take effect
2022-06-28 12:20:00 【Unique_ eight hundred and forty-nine million nine hundred and n】
When I want to add... To the special effects in the game Canvas And modify overrideSorting when , It is found that although the code is executed , But it didn't get the expected effect .
Canvas _canvas = m_princeEffectGo.AddComponent<Canvas>();
_canvas.overrideSorting = true;Finally, I found that if Awake If you change it , Can't modify successfully , Only in Start Revision in China .
But then I used the framework of our project to write a test code to hang in UI Up test , Whether it's Awake still Start It will be carried out .
using UnityEngine;
using YoukiaUnity.App;
public class CanvasTest : MonoSwitch
{
public GameObject canvas;
public override void OnAwake()
{
base.OnAwake();
GameObject _go = Instantiate(canvas, transform);
Canvas _canvas = _go.AddComponent<Canvas>();
_canvas.overrideSorting = true;
}
protected override void Initialization()
{
base.Initialization();
GameObject _go = Instantiate(canvas, transform);
Canvas _canvas = _go.AddComponent<Canvas>();
_canvas.overrideSorting = true;
}
}Can't move why Awake Set in Canvas Of overrideSorting Don't take effect ! Take a brief note of !
边栏推荐
- Allez, Meta - Cosme, comme prévu, cette chaleur ne durera pas longtemps.
- Convert black mask picture to color annotation file
- 【Unity编辑器扩展实践】、查找所有引用该图片的预制体
- NFT card chain game system development DAPP construction technical details
- Mutual conversion between mytipartfile and file
- Self use demo of basic component integration of fluent
- 【C语言】如何产生正态分布或高斯分布随机数
- Web3安全连载(3) | 深入揭秘NFT钓鱼流程及防范技巧
- 建立自己的网站(18)
- Unity加载设置:Application.backgroundLoadingPriority
猜你喜欢

【Unity编辑器扩展实践】、通过代码查找所有预制

Deep learning has a new pit! The University of Sydney proposed a new cross modal task, using text to guide image matting

Using soapUI to obtain freemaker's FTL file template

Remoteviews layout and type restriction source code analysis

Web3 security serials (3) | in depth disclosure of NFT fishing process and prevention techniques
Three ways to implement LRU cache (recommended Collection)
![[Beijing University of Aeronautics and Astronautics] information sharing for the first and second examinations of postgraduate entrance examination](/img/06/df5a64441814c9ecfa2f039318496e.jpg)
[Beijing University of Aeronautics and Astronautics] information sharing for the first and second examinations of postgraduate entrance examination

洛谷_P1303 A*B Problem_高精度计算

Chendanqi, Fang Fei, guquanquan and Li Bo won the prize, and the list of Sloan research award in 2022 was released

Leetcode 48. 旋转图像(可以,已解决)
随机推荐
【C语言】二叉树的实现及三种遍历
Leetcode 705. 设计哈希集合
Open3d manual clipping point cloud
Swin, three degrees! Eth open source VRT: a transformer that refreshes multi domain indicators of video restoration
【Unity编辑器扩展实践】、利用txt模板动态生成UI代码
UGUI强制刷新Layout(布局)组件
Deep learning has a new pit! The University of Sydney proposed a new cross modal task, using text to guide image matting
Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
IDEA全局搜索快捷设置
Redis hash hash type string (5)
5. Sum of N numbers
Remoteviews layout and type restriction source code analysis
【C语言】判断三角形
Many benefits of SEO optimization are directly related to traffic
IO stream of file and Base64
JS foundation 8
ArrayList源码解析
MapReduce项目案例1
2. single digit statistics
Custom title bar view