「Unity/おすすめアセット/HeroEditor4D」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→エディタの使い方と作成したキャラの配置) |
(→顔を色を変更) |
||
行20: | 行20: | ||
character4D.BodyColor = new Color(0.1f, 0.9f, 0.9f); | character4D.BodyColor = new Color(0.1f, 0.9f, 0.9f); | ||
character4D.OnValidate(); | character4D.OnValidate(); | ||
+ | </pre> | ||
+ | |||
+ | ==jsonデータ読み込み== | ||
+ | <pre> | ||
+ | string json = @" | ||
+ | {'Body':'Basic/HumanPants#FFC878FF','Ears':'Basic/Human#FFC878FF','Hair':'Basic/Default','Beard':null,'Helmet':'Basic/AlchemistClothes','Armor':'Basic/TemplarArmor','PrimaryWeapon':'Basic/BlackSteelAxe','SecondaryWeapon':null,'Cape':null,'Back':null,'Shield':'Basic/Bloodmoon','Bow':null,'Crossbow':'Basic/BlackSteelAxe','WeaponType':'Melee1H','Expression':'Default','HideEars':'True','CropHair':'False','Makeup':null,'Mask':null,'Earrings':null,'Expression.Default.Eyebrows':'Basic/Eyebrows7','Expression.Default.Eyes':'Emoji/AngryEyes1#00C8FFFF','Expression.Default.Mouth':'Basic/Default','Expression.Angry.Eyebrows':'Emoji/AngryEyebrowns','Expression.Angry.Eyes':'Emoji/AngryEyes3#00C8FFFF','Expression.Angry.Mouth':'Emoji/AngryMouth1','Expression.Dead.Eyebrows':'Emoji/DeadEyebrowns1','Expression.Dead.Eyes':'Emoji/DeadEyes3#00C8FFFF','Expression.Dead.Mouth':'Emoji/DeadMouth1','Expression.Happy.Eyebrows':'Emoji/DeadEyebrowns1','Expression.Happy.Eyes':'Emoji/HappyEyes#00C8FFFF','Expression.Happy.Mouth':'Basic/Smirk'} | ||
+ | "; | ||
+ | character4D.LoadFromJson(json, silent: false); | ||
</pre> | </pre> |
2021年4月22日 (木) 10:48時点における版
HeroEditor4D
エディタの使い方と作成したキャラの配置
- HeroEditor4Dをインストールする
- Assets/HeroEditor4D/FantasyHeroes/CharacterEditor [FH]を開き、"Save/Prefab"を押し、Humanという名前でファイルを保存する。
- シーンを新たに作り、以下をオブジェクトを、作ったシーンに、コピーし、Humanもシーン内に移動する。
CharacterControls CharacterEquipment CharacterAppearance
- 実行すれば、キャラが動く。
顔を色を変更
using Assets.HeroEditor4D.Common.CharacterScripts; Character4D character4D = GameObject.Find("Human").GetComponent<Character4D>(); character4D.BodyColor = new Color(0.1f, 0.9f, 0.9f); character4D.OnValidate();
jsonデータ読み込み
string json = @" {'Body':'Basic/HumanPants#FFC878FF','Ears':'Basic/Human#FFC878FF','Hair':'Basic/Default','Beard':null,'Helmet':'Basic/AlchemistClothes','Armor':'Basic/TemplarArmor','PrimaryWeapon':'Basic/BlackSteelAxe','SecondaryWeapon':null,'Cape':null,'Back':null,'Shield':'Basic/Bloodmoon','Bow':null,'Crossbow':'Basic/BlackSteelAxe','WeaponType':'Melee1H','Expression':'Default','HideEars':'True','CropHair':'False','Makeup':null,'Mask':null,'Earrings':null,'Expression.Default.Eyebrows':'Basic/Eyebrows7','Expression.Default.Eyes':'Emoji/AngryEyes1#00C8FFFF','Expression.Default.Mouth':'Basic/Default','Expression.Angry.Eyebrows':'Emoji/AngryEyebrowns','Expression.Angry.Eyes':'Emoji/AngryEyes3#00C8FFFF','Expression.Angry.Mouth':'Emoji/AngryMouth1','Expression.Dead.Eyebrows':'Emoji/DeadEyebrowns1','Expression.Dead.Eyes':'Emoji/DeadEyes3#00C8FFFF','Expression.Dead.Mouth':'Emoji/DeadMouth1','Expression.Happy.Eyebrows':'Emoji/DeadEyebrowns1','Expression.Happy.Eyes':'Emoji/HappyEyes#00C8FFFF','Expression.Happy.Mouth':'Basic/Smirk'} "; character4D.LoadFromJson(json, silent: false);