예제 #1
0
        IEnumerator ActiveHolder(vWeaponHolder holder, bool activeWeapon, bool immediat = false)
        {
            if (!immediat)
            {
                inEquip = true;
            }

            timer = holder.equipDelayTime;
            holder.SetActiveHolder(true);

            if (!activeWeapon)
            {
                holder.SetActiveWeapon(true);
            }

            while (timer > 0 && !immediat)
            {
                yield return(new WaitForEndOfFrame());

                timer -= Time.deltaTime;
            }

            holder.SetActiveWeapon(activeWeapon);
            inEquip = false;
        }
예제 #2
0
        IEnumerator UnequipRoutine(vWeaponHolder holder, bool activeHolder, bool activeWeapon, bool immediat = false)
        {
            holder.SetActiveHolder(activeHolder);
            if (!inEquip && !immediat) // ignore time if inEquip or immediate unequip
            {
                equipTime = holder.equipDelayTime;
                while (equipTime > 0 && !immediat && !inEquip)
                {
                    yield return(null);

                    equipTime -= Time.deltaTime;
                }
            }
            holder.SetActiveWeapon(activeWeapon);
        }
예제 #3
0
        IEnumerator EquipRoutine(vWeaponHolder holder, bool activeHolder, bool activeWeapon, bool immediat = false)
        {
            if (!immediat)
            {
                inEquip = true;
            }
            holder.SetActiveHolder(activeHolder);
            equipTime = holder.equipDelayTime;
            while (equipTime > 0 && !immediat) // ignore time if  immediate equip
            {
                yield return(null);

                equipTime -= Time.deltaTime;
            }

            holder.SetActiveWeapon(activeWeapon);
            inEquip = false;
        }