简体   繁体   English

Unity(NGUI)如何在滚动视图中缩放对象

[英]Unity (NGUI) how to scale object in scroll view

Using NGUI I created a horizontal scrollview with NGUI's example code "UICenter on Child". 使用NGUI,我使用NGUI的示例代码“ UICenter on Child”创建了一个水平滚动视图。 This is working properly. 这工作正常。 I want to dynamically scale the center sprite to 120%. 我想将中心精灵动态缩放到120%。 How can I accomplish this? 我该怎么做? I am new to Unity so please provide a complete syntax -- something I can copy and paste into my code. 我是Unity新手,因此请提供完整的语法-可以将某些内容复制并粘贴到我的代码中。 Thanks! 谢谢!

Try default option: 尝试默认选项:

Transform mainTransform;

void Start()
{
    mainTransform = transform;

    mainTransform.localScale = Vector3.one * 1.2f;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM