[{PageViewPlugin}] [Minecraft Programming] !!!Abstract 本当は、マイクラ上で作りたかったが、パラメータの表示Addonですら作れなかったので、別の方法を試してみる。例えばUnityとか。 !!!Topics !!2D RPG by Unity |とりあえず、Unityなら情報もたくさんありそうだし、[1]に従ってやってみよう。やりたいことは *好きな敵を追加する。-> add asset file to EnemyData and add image file to Character Image *出現する敵がランダムに変わるようにしたい。->元からそうだった *主人公を変えたい。基礎能力値を上げる-> playerParameters.asset *add MP(Magic Point) -> Battle Windows parameters, BattleParameter.cs, BattleWindow.cs, MainMenu.cs *add Magic *appropriate Level up -> battleParameter.cs, playerParameter.asset *implement evolution *implement titles and skills To add “Skills”: Add SkillInventory to MenuWindow, (in inspector of Unity, we can connect script and parameters) Add updateSkills in MainMenu.cs, MenuRoot.cs Add Skills to BattleWindow, I’m wondering why it is not disappeared List<Skill> Skills to BattleParameter.cs hey, each skill has level, and each monster and character has its own level. need modification. *韋駄天スキル | use List.find[6]。レベルアップ時の処理をこれから *implement eat command *implement SP *speed display is OK, next is order of attack depending on speed *skills of enemies !!その他 *Debug |Visual Studioがいいかも。Unity Hub経由でインストール後、Unity側のExternal Toolsの設定でVisual Studioを設定しましょう[5]。そうすると、Scriptを開くだけで、プロジェクトを読み込んでくれて、再生ボタンを押すとUnityにアタッチするので、その状態でUnityで動作を始めるとデバッガーが動き、マークしていたところで止まってくれます。変数の中身とかも見れます。 *AssetとScript |AssetとScriptの関係は、途中から変更できないと理解。新しい種類のAssetを追加する場合は、まずScriptでClassを定義しておいて、そのClassに紐づいたAssetをメニューからCreateするイメージ *プレハブ化? |GameObjectを再利用できるようにするらしい[2]. *TileMapにMapチップを貼り付けると小さい |それは、元の画像ファイルのPixels Per Unitの値が正しくないかららしい。Sliceする前の画像のInspectorのなかにPixels Per Unitを探して、デフォルト100になっているので、それをピクセルサイズ、32とかに直してApplyすると治ったりする。[3] *マップをレイヤーで重ねるときの順番 |Gridのinspectorの中にSorting LayerにOrder in Layerという数字をいれるところがある。数字が大きいほど前面に出る[4]。 *[C_Sharp] |Unityで使われているのは、C#。プログラミング言語の一つで、[Java]に似ているような気がするが、たまによくわからない表現がある。調べます。 *IEnumerator + yield returns + WaitWhile(()=>conditions) |[7]に参考あり。何となく、IEnumeratorが繰り返され、条件が満たされる間は待ちなさい、だから条件が満たされなくなったら(**に)抜け出す、って感じか。 !!!Reference #[#1]Unity C# 2DRPGゲームの作り方 ~ドラクエ風レトロRPGを作ろう!~, [https://feynman.co.jp/unityforest/game-create-lesson/2drpg-game/] #[#2]2022年02月12日, ohbashunsuke, UnityのPrefab(プレハブ)とは?使い方まで徹底解説, [https://shibuya24.info/entry/unity-prefab] #[#3]2022年05月17日, ohbashunsuke, 【2Dゲームで必須】UnityのSprite(スプライト)の単位をわかりやすく解説, [https://shibuya24.info/entry/unity-unit] #[#4]【Unity入門】Unity2D 画像の前後を変える方法(SpriteRenderer)!1分からの簡単Unity入門, [https://frog-blend.hatenablog.com/entry/2023/10/05/155921] #[#5]2025年1月30日, オオバ,【2025年版】Visual StudioをインストールしてUnityで使う方法, [https://shibuya24.info/entry/unity-install-visualstudio] #[#6]【C#入門】Listの要素を検索するFindの使い方(FindAll/FindIndex), [https://www.sejuku.net/blog/45252?utm_source=blog&utm_medium=blog&utm_campaign=blog__45381] #[#7]WaitWhile, [https://docs.unity3d.com/6000.1/Documentation/ScriptReference/WaitWhile.html]