所以在我的Unity游戏场景开始时,我希望文本显示几秒钟。我该怎么做?
答案 0 :(得分:0)
你可以像这样在一定时间后调用一个方法。将脚本放在画布上并将文本拖到canvasText插槽。
using UnityEngine;
using UnityEngine.UI;
public class CanvasScript : MonoBehaviour
{
public Text canvasText1;
void Start ()
{
Invoke("DisableText", 5f);//invoke after 5 seconds
}
void DisableText()
{
canvasText1.enabled = false;
}
}
答案 1 :(得分:0)
http://answers.unity3d.com/questions/907707/need-text-to-display-after-5-seconds.html
<item name="android:datePickerDialogTheme">@style/style_date_picker_dialog</item>
</style>
<style name="style_date_picker_dialog" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowIsFloating">true</item>
<item name="android:windowBackground">@drawable/dialog_background</item>
<item name="android:datePickerStyle">@style/style_datepicker</item>
</style>
<style name="style_datepicker" parent="android:Widget.Material.Light.DatePicker">
<item name="android:datePickerMode">spinner</item>
</style>
感谢您的回答,对我来说非常有用!