예제 #1
0
        void Start()
        {
            var defaultPickupInstance = Instantiate(DefaultWeaponPickup);

            DefaultWeaponUpgradePath = defaultPickupInstance.weaponUpgradePathInitial();
            Destroy(defaultPickupInstance.gameObject);
            AttachWeapon(defaultWeaponPrefab, DefaultWeaponUpgradePath);
        }
예제 #2
0
        public void AttachWeapon(Weapon weaponPrefab, WeaponUpgradePath upgradePath)
        {
            var weaponInstance = Instantiate(weaponPrefab, transform);

            weaponInstance.bulletColor  = settings.color;
            weaponInstance.PlayerNumber = settings.playerNumber;

            if (activeWeaponInstance != null)
            {
                Destroy(activeWeaponInstance.gameObject);
            }
            activeWeaponInstance    = weaponInstance;
            ActiveWeaponUpgradePath = upgradePath;

            AFEventManager.INSTANCE.PostEvent(AFEvents.WeaponUpgrade(
                                                  settings.playerNumber,
                                                  upgradePath.UpgradeProgress,
                                                  upgradePath.UpgradeColor
                                                  ));
        }