public override void Awake()
 {
     base.Awake();
     charactersData        = new CharacterCustomizableData[2];
     inputOutputController = new IOController();
     SetAnimationDictionary();
     SetStyleDictionary();
 }
Ejemplo n.º 2
0
    private CharacterCustomizableData CreateNewCharacter()
    {
        CharacterCustomizableData newChar = new CharacterCustomizableData();

        newChar.name             = "New Character";
        newChar.currentAnimation = 0;
        newChar.currentStyle     = 0;
        return(newChar);
    }
Ejemplo n.º 3
0
    public void SaveCharacterDataToDisk(GameManagerController.CHARACTERINDEX index, CharacterCustomizableData data)
    {
        string filePath = Path.Combine(Application.persistentDataPath, index.ToString() + ".json");


        string json = JsonUtility.ToJson(data);

        File.WriteAllText(filePath, json);
    }
    private void SetupInfo()
    {
        CharacterCustomizableData initialData = GameManagerController.Instance.GetCharacterData(GameManagerController.Instance.GetSelectedCharacter());

        editableData.name             = initialData.name;
        editableData.currentAnimation = initialData.currentAnimation;
        editableData.currentStyle     = initialData.currentStyle;

        nameInput.text     = editableData.name;
        animationName.text = GameManagerController.Instance.animationNames[editableData.currentAnimation];
        styleName.text     = GameManagerController.Instance.styles[editableData.currentStyle].Name;
    }
    private void Awake()
    {
        editableData = new CharacterCustomizableData();
        discardButton.onClick.AddListener(OnDiscardPressed);
        saveButton.onClick.AddListener(OnSavePressed);
        animationLeftArrow.onClick.AddListener(OnAnimLeftArrowPressed);
        animationRightArrow.onClick.AddListener(OnAnimRightArrowPressed);
        styleLeftArrow.onClick.AddListener(OnStyleLeftArrowPressed);
        styleRightArrow.onClick.AddListener(OnStyleRightArrowPressed);


        OnAnimationChangedArgs += characterContainer.OnAnimationChanged;
        OnStyleChangedArgs     += characterContainer.OnStyleChanged;
    }
Ejemplo n.º 6
0
    public CharacterCustomizableData LoadCharacterDataFromDisk(GameManagerController.CHARACTERINDEX i)
    {
        string filePath = Path.Combine(Application.persistentDataPath, i.ToString() + ".json");
        CharacterCustomizableData cData = null;

        if (File.Exists(filePath))
        {
            string dataAsJson = File.ReadAllText(filePath);
            cData = JsonUtility.FromJson <CharacterCustomizableData>(dataAsJson);
            return(cData);
        }
        else
        {
            cData = CreateNewCharacter();
            SaveCharacterDataToDisk(i, cData);
        }

        return(cData);
    }
Ejemplo n.º 7
0
 protected void InitializeCharacter()
 {
     data = GameManagerController.Instance.GetCharacterData(index);
     UpdateCharacter();
 }
 public void InjectDataOnCharacter(CharacterCustomizableData data)
 {
     customizableCharacter.Data = data;
 }
 public void SaveCharacterData(CHARACTERINDEX index, CharacterCustomizableData data)
 {
     inputOutputController.SaveCharacterDataToDisk(index, data);
 }