コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }