お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close永続的なデータディレクトリのパスを返します(RO)
値はアプリケーションが実行されている間データを維持して保存することが予想されるディレクトリパスです。iOSとAndroidをパブリッシュした時、persistentDataPathはデバイスのpublicディレクトリとなります。この場所はアプリケーションの更新ごとにファイルは削除はされません。ですが、ユーザーのアクションに対しては安全ではないことに注意してください。例えば、AndroidではSDカードを削除すると保存していたデータにアクセスすることはできなくなります。アプリケーションをビルドした時、GUIDはバンドルIDを基にして生成され、persistentDataPathの一部で使用されることに注意してください。もし将来のバージョンで同じバンドルIDを維持した場合、アプリケーションは毎回アップデートしても同じ場所にアクセスしようとします。
// print the path to the persistent data folder print (Application. persistentDataPath);
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { print(Application.persistentDataPath); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: print(Application.persistentDataPath)