Quest Update
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
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 == null){return;}
|
||||
if(CharacterSelection.selectedCharJson.Length <= 0){return;}
|
||||
character.FromJson(CharacterSelection.selectedCharJson, true);
|
||||
}
|
||||
}
|
||||
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 == null){return;}
|
||||
if(CharacterSelection.selectedCharJson.Length <= 0){return;}
|
||||
character.FromJson(CharacterSelection.selectedCharJson, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user