public override void OnStart() { _camera = Camera.MainCamera; _bulletPool = new ObjectPool <BulletController>(SpawnBullet); Player = new Player((Defaults)Defaults.CreateInstance()); HpBar.Init(Player.Hp); }
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); }
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()); }
public override void OnStart() { base.OnStart(); if (WeaponSettings == null) { Debug.LogError("No settings for the weapon were found"); return; } _data = WeaponSettings.CreateInstance <WeaponData>(); }
public override void OnStart() { Enemy = new Enemy((Defaults)Defaults.CreateInstance()); HpBar.Init(Enemy.Hp, Actor); }