private void OnEnable() { assetBank = new Dictionary <string, Object> (assets.Length); for (var i = 0; i < assets.Length; ++i) { var asset = assets[i]; assetBank.Add(asset.name, asset.asset); } Instance = this; }
protected override void Awake() { rigidbody = gameObject.AddComponent <Rigidbody> (); rigidbody.isKinematic = true; PrepareWeapon(); assetDefaults = WeaponAssetDefaults.Instance; pool = ObjectPool.Instance; weaponProperties = new float[Enum.GetValues(typeof(WeaponProperty)).Length]; isReloading = false; }