示例#1
0
        public void Initialize(Weapon weapon)
        {
            Enable();

            weapon.PowerUpdateEvent += OnPowerUpdate;
            weapon.ActivatedEvent += OnActivated;
            weapon.EnabledEvent += OnEnabled;
        }
示例#2
0
        protected override void OnTriggerEnter(Collider other)
        {
            if (!other.CompareTag("Player")) return;

            StopAllCoroutines();

            var oppHealth = (Health)other.gameObject.GetComponent(typeof(Health));
            oppHealth.RecieveHit(sender, damage);

            disabledWeapon = other.GetComponent<Player>().Weapons.weapons[UnityEngine.Random.Range(0, Player.Weaponlimit)];
            if (disabledJob != null) disabledJob.Kill();
            disabledJob = new Job(Disable());

            myPoolObject.Disable();
        }