Esempio n. 1
0
 public override void OnStart()
 {
     _camera     = Camera.MainCamera;
     _bulletPool = new ObjectPool <BulletController>(SpawnBullet);
     Player      = new Player((Defaults)Defaults.CreateInstance());
     HpBar.Init(Player.Hp);
 }
Esempio n. 2
0
 private static SettingsBase LoadAsset(JsonAsset asset, string typename)
 {
     if (asset && !asset.WaitForLoaded() && asset.DataTypeName == typename)
     {
         if (asset.CreateInstance() is SettingsBase result)
         {
             return(result);
         }
     }
     return(null);
 }
Esempio n. 3
0
 private static T LoadAsset <T>(JsonAsset asset) where T : new()
 {
     if (asset && !asset.WaitForLoaded())
     {
         if (asset.CreateInstance() is T result)
         {
             return(result);
         }
     }
     return(new T());
 }
Esempio n. 4
0
        public override void OnStart()
        {
            base.OnStart();

            if (WeaponSettings == null)
            {
                Debug.LogError("No settings for the weapon were found");
                return;
            }

            _data = WeaponSettings.CreateInstance <WeaponData>();
        }
Esempio n. 5
0
 public override void OnStart()
 {
     Enemy = new Enemy((Defaults)Defaults.CreateInstance());
     HpBar.Init(Enemy.Hp, Actor);
 }