Last active
May 29, 2018 14:42
-
-
Save triacontane/5079e4ac747d5678522b12c74fbb4b38 to your computer and use it in GitHub Desktop.
モジュール変数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $aaaaa = 3 | |
| module Kinoko | |
| VALUE1 = 1 # モジュール変数の定義 : OK | |
| VALUE2 = $game_variables[3] # モジュール変数にゲーム変数を設定 : エラー($game_variablesが未定義なので) | |
| VALUE4 = $aaaaa # モジュール変数にグローバル変数を設定 : OK(ただし、$aaaaaに値を再代入してもVALUE4の値に変化なし) | |
| VALUE5 = 0 | |
| end | |
| # イベントコマンドの「スクリプト」から実行 | |
| Kinoko::VALUE1 = 2 # 定義している変数の変更 : OK | |
| Kinoko::VALUE3 = 3 # 定義していない変数の変更 : OK | |
| Kinoko::VALUE5 = $game_variables[3] # ゲーム変数を設定 : OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment