Vector2 DESize=new Vector2(Screen.width,Screen.height/4F);
Vector2 DEOffset=new Vector2(Screen.width/2f,Screen.height/8f);
float WordScaleX = 3.75f;
float WordScaleY = 2F;
DarkEmpireBtn.sizeDelta = DESize;
DEBox.size = DESize;
DarkEmpireBtn.anchoredPosition = DEOffset;
DEBox.offset = DEOffset;
DarkEmpireWord.anchoredPosition = DEOffset;
DarkEmpireWord.localScale = new
Vector3(DarkEmpireWord.localScale.x*WordScaleX,DarkEmpireWord.localScale.y*WordScaleY,1f);
另一个脚本:
void Start()
{
BtnOriColor = this.transform.gameObject.GetComponent<Image>().color;
}
void OnMouseEnter()
{
this.transform.gameObject.GetComponent<Image>().color = new Color(BtnOriColor.r,BtnOriColor.g,BtnOriColor.b,170F);
}
void OnMouseExit()
{
this.transform.gameObject.GetComponent<Image>().color = BtnOriColor;
}
代码没有反应,不知道哪里出错了?希望老师指导一下,谢谢!
同学你好,直接把脚本文件或者完整版代码给老师看看
问题出在AdvModeChooseLevelScene里面,麻烦老师好人做到底,顺便帮我看看StartGame场景里的SetPanel中的bug,谢谢老师了
引用全部丢失了,使用的Unity版本是多少的?同学如果想要UGUI自适应,可以参考一下:
https://blog.csdn.net/civilman/article/details/52681215?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~first_rank_v2~rank_v25-2-52681215.nonecase&utm_term=unity%20%E6%8C%89%E9%92%AE%E8%87%AA%E9%80%82%E5%BA%94
https://blog.csdn.net/qq_38411133/article/details/82354738?utm_source=blogxgwz0
另外老师只能给出修改建议,做具体需求是我们自己的事情哦,这个在之后工作也是一样的