簡體   English   中英

比賽結束后表演一次

[英]Show scene once after lunching the game

你好! 我正在制作一個游戲,我想在游戲開始時添加一個教程(演練)。 因此,我創建了一個包含所有信息的場景,現在我只想在游戲啟動后展示一次,然后再也不展示。

我已經在互聯網上搜索了相關信息。 我只找到了一些關於PlayerPrefs 的信息,我真的不知道如何使用它。

感謝您的時間!

您可以像這樣在 PlayerPrefs 中設置變量:

PlayerPrefs.SetInt("IsFirstRun", 1);

然后你可以檢查變量是否存在:

if(PleyerPrefs.HasKey("IsFirstRun")) // show the scene

這是您的腳本的外觀:

void Start()
{
     if(!PleyerPrefs.HasKey("IsFirstRun"))
     {
     // open scene
     PlayerPrefs.SetInt("IsFirstRun", 1);
     }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM