当前位置:网站首页>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 !
边栏推荐
- Remoteviews layout and type restriction source code analysis
- [C language] use of file read / write function
- Asynctask experience summary
- Redis principle - List
- 【C语言】结构体嵌套二级指针的使用
- 【C语言】二叉树的实现及三种遍历
- 【Unity编辑器扩展基础】、GUI
- 4. maximum continuity factor
- 【附源码+代码注释】误差状态卡尔曼滤波(error-state Kalman Filter),扩展卡尔曼滤波,实现GPS+IMU融合,EKF ESKF GPS+IMU
- JS foundation 8
猜你喜欢

Self use demo of basic component integration of fluent

Why do many people want to change careers as programmers, while some programmers want to change careers as others?
![[C language] use of nested secondary pointer of structure](/img/59/8b61805431e152995c250f6dd08e29.png)
[C language] use of nested secondary pointer of structure
![[C language] three sorting methods for random number files](/img/a5/363133a0c85aa43c6cd8287e479f71.jpg)
[C language] three sorting methods for random number files

建立自己的网站(18)

Still using simpledateformat for time formatting? Be careful that the project collapses!

【C语言】关于scanf()与scanf_s()的一些问题

EMC RS485接口EMC电路设计方案
![[C language] about scanf() and scanf_ Some problems of s()](/img/d1/e3d0b845e699c8c1fe3eb9f3b250e1.png)
[C language] about scanf() and scanf_ Some problems of s()

Oracle date format exception: invalid number
随机推荐
Come on, yuanuniverse. Sure enough, the heat won't pass for a while
JNI confusion of Android Application Security
内部振荡器、无源晶振、有源晶振有什么区别?
【JS】斐波那契数列实现(递归与循环)
Necessary for beginners PR 2021 quick start tutorial, PR green screen matting operation method
洛谷_P1303 A*B Problem_高精度计算
[C language] three sorting methods for random number files
Redis 原理 - List
Leetcode 48. 旋转图像(可以,已解决)
Graphics view framework for QT learning (to realize startup animation)
Chendanqi, Fang Fei, guquanquan and Li Bo won the prize, and the list of Sloan research award in 2022 was released
Swin, three degrees! Eth open source VRT: a transformer that refreshes multi domain indicators of video restoration
The development and principle of the metacosmic system
What method is required for word, PDF and txt files to realize full-text content retrieval?
【C语言】判断三角形
【C语言】随机数文件对其进行三种排序方法
1. print hourglass
【Unity编辑器扩展实践】、查找所有引用该图片的预制体
2. single digit statistics
UGUI使用小技巧(六)Unity实现字符串竖行显示