This commit is contained in:
NimXD
2024-09-26 20:53:03 +05:30
parent dfe47c1fb8
commit c29b03d428
212 changed files with 291654 additions and 1622 deletions

View File

@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using Assets.HeroEditor4D.Common.Scripts.CharacterScripts;
using UnityEngine;
public class ChangeCharacterOnSelection : MonoBehaviour
{
public Character4D character;
void Start(){
CharacterSelection.OnCharacterChanged += RefreshCharacter;
RefreshCharacter();
}
void OnDestroy()
{
CharacterSelection.OnCharacterChanged -= RefreshCharacter;
}
void RefreshCharacter(){
if(CharacterSelection.selectedCharJson.Length <= 0){return;}
character.FromJson(CharacterSelection.selectedCharJson, true);
}
}