Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsubaki/SerializedParameter_Unity
https://github.com/tsubaki/SerializedParameter_Unity
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tsubaki/SerializedParameter_Unity
- Owner: tsubaki
- Created: 2013-10-31T07:37:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2013-10-31T08:43:28.000Z (over 10 years ago)
- Last Synced: 2024-01-30T17:22:50.058Z (5 months ago)
- Language: C#
- Size: 254 KB
- Stars: 14
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Lists
- awesome-unity - SerializedParameter_Unity - Persist data between play mode sessions attribute. (:pencil2: Scripting <a name="scripting"></a> / Attributes <a name="attributes"></a>)
- AwesomeUnityCommunity - SerializedParameter_Unity - Persist data between play mode sessions attribute. (:pencil2: Scripting <a name="scripting"></a> / Attributes <a name="attributes"></a>)
README
PersistentAmongPlayMode_Unity
=========================エディタ上でゲーム実行時に変更したフィールド変数を保持します。
![pre game](https://raw.github.com/tsubaki/SerializedParameter_Unity/gh-pages/01.jpg)
![playing game](https://raw.github.com/tsubaki/SerializedParameter_Unity/gh-pages/02.jpg)
起動後に値を変更![exit game](https://raw.github.com/tsubaki/SerializedParameter_Unity/gh-pages/03.jpg)
プレイ終了後も値を保持#使い方
publicの変数に[PersistentAmongPlayMode]を付ける。
構造体・クラス・プリミティブな値どれでも可…だと思う。```
using UnityEngine;public class SampleComponent : MonoBehaviour
{
[PersistentAmongPlayMode]
public string msg = string.Empty;public int count = 0;
[PersistentAmongPlayMode]
public int serializeCount = 0;
}
```--
This software is released under the MIT License, see LICENSE.txt.