migration from new repo
This commit is contained in:
commit
423134a840
26930 changed files with 3458568 additions and 0 deletions
67
Assets/_/Features/Tests/Runtime/TestFacts.cs
Normal file
67
Assets/_/Features/Tests/Runtime/TestFacts.cs
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Core.Runtime;
|
||||
using Core.Runtime.Interfaces;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TestFacts.Runtime
|
||||
{
|
||||
public class TestFacts : BaseMonobehaviour
|
||||
{
|
||||
string _fact;
|
||||
|
||||
void Start()
|
||||
{
|
||||
GameManager.Instance.Profile = "Guilde_de_Toine";
|
||||
}
|
||||
|
||||
[ContextMenu("Créer un fait")]
|
||||
public void CreateFact()
|
||||
{
|
||||
SetFact<string>("fact", "Mon premier fait");
|
||||
_fact = GetFact<string>("fact");
|
||||
}
|
||||
|
||||
[ContextMenu("Créer un fait persistant")]
|
||||
public void CreatePersistentFact()
|
||||
{
|
||||
SetFact<string>("fact", "Mon premier fait persistant", FactPersistence.Persistent);
|
||||
_fact = GetFact<string>("fact");
|
||||
}
|
||||
|
||||
[ContextMenu("Sauver les donénes")]
|
||||
public void Sauver()
|
||||
{
|
||||
SaveFacts();
|
||||
}
|
||||
|
||||
[ContextMenu("Charger les données")]
|
||||
public void Charger()
|
||||
{
|
||||
LoadFacts();
|
||||
|
||||
GetAllFactsPlease();
|
||||
}
|
||||
|
||||
[ContextMenu("Supprimer un fait")]
|
||||
public void RemoveFact()
|
||||
{
|
||||
RemoveFact<string>("fact");
|
||||
}
|
||||
|
||||
[ContextMenu("Supprimer la sauvegarde")]
|
||||
public void DeleteSave()
|
||||
{
|
||||
DeleteSaveFile();
|
||||
}
|
||||
|
||||
[ContextMenu("Voir tous les faits")]
|
||||
public void GetAllFactsPlease()
|
||||
{
|
||||
foreach (var fact in GetAllFacts())
|
||||
{
|
||||
Info($"Fact[{fact.Key}] = {fact.Value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue