コード例 #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);
        }
コード例 #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);
 }
コード例 #3
0
 // Private
 private void SaveData()
 {
     StaticHealthStorage.StoreData(this);
 }