Exemplo n.º 1
0
        private void Awake()
        {
            // load data if possible
            StaticHealth healthFromLoad = StaticHealthStorage.loadData(gameObject.name);

            if (healthFromLoad != null)
            {
                health = healthFromLoad;
                return;
            }

            // else create one
            health = new StaticHealth(healthData, gameObject.name, isFreezable);
        }
Exemplo n.º 2
0
 // This method will delete data in health Storage (Only use it when this script is lastly appear in scene)
 public void DeleteData()
 {
     StaticHealthStorage.RemoveData(health);
 }
Exemplo n.º 3
0
 // Private
 private void SaveData()
 {
     StaticHealthStorage.StoreData(this);
 }