Example #1
0
    public void ResetWeaponOnly(int[] usables)
    {
        deltaTime = 0f;
        ClearAllWeapons();
        for (int i = 0; i < usables.Length; i++)
        {
            string empty = string.Empty;
            if (usables[i] != 4)
            {
                TItem.SLOT slot = (TItem.SLOT)(2 + usables[i]);
                Item       currentWeaponBySlot = MyInfoManager.Instance.GetCurrentWeaponBySlot(slot);
                empty = currentWeaponBySlot.Code;
            }
            else
            {
                empty = RoomManager.Instance.ModeSpecificWeaponCode;
            }
            equipments[usables[i]] = null;
            if (empty.Length > 0)
            {
                equipments[usables[i]] = Equip(empty);
            }
        }
        prevWeaponType    = -1;
        currentWeaponType = (int)RoomManager.Instance.DefaultWeaponType;
        VerifyNextWeapon();
        WeaponChanger component = GetComponent <WeaponChanger>();

        if (null != component)
        {
            component.Initialize(equipments);
        }
        SwapWeapon(initiallyDrawn: true);
    }
Example #2
0
    public void catchBuildGun(int[] usables)
    {
        deltaTime = 0f;
        ClearAllWeapons();
        for (int i = 0; i < usables.Length; i++)
        {
            string empty = string.Empty;
            if (usables[i] != 4)
            {
                TItem.SLOT slot = (TItem.SLOT)(2 + usables[i]);
                empty = MyInfoManager.Instance.GetUsingBySlot(slot);
            }
            else
            {
                empty = "Composer3";
            }
            equipments[usables[i]] = null;
            if (empty.Length > 0)
            {
                equipments[usables[i]] = Equip(empty);
            }
        }
        prevWeaponType    = -1;
        currentWeaponType = 4;
        VerifyNextWeapon();
        WeaponChanger component = GetComponent <WeaponChanger>();

        if (null != component)
        {
            component.Initialize(equipments);
        }
        SwapWeapon(initiallyDrawn: true);
    }
Example #3
0
    public void Initialize(int[] usables)
    {
        deltaTime = 0f;
        HideDummyMesh();
        firstPerson = base.transform.Find(firstPersonBody);
        if (null == firstPerson)
        {
            Debug.LogError("Fail to find first person body ");
        }
        else
        {
            firstPerson.localPosition = firstPersonOffsetOnEmptyHand;
        }
        rightHand = base.transform.Find(rightHandBone);
        if (null == rightHand)
        {
            Debug.LogError("Fail to find right hand bone");
        }
        leftHand = base.transform.Find(leftHandBone);
        if (null == leftHand)
        {
            Debug.LogError("Fail to find left hand bone");
        }
        equipments = new GameObject[5];
        for (int i = 0; i < 5; i++)
        {
            equipments[i] = null;
        }
        for (int j = 0; j < usables.Length; j++)
        {
            string empty = string.Empty;
            if (usables[j] != 4)
            {
                TItem.SLOT slot = (TItem.SLOT)(2 + usables[j]);
                empty = MyInfoManager.Instance.GetUsingBySlot(slot);
            }
            else
            {
                empty = RoomManager.Instance.ModeSpecificWeaponCode;
            }
            equipments[usables[j]] = null;
            if (empty.Length > 0)
            {
                equipments[usables[j]] = Equip(empty);
            }
        }
        prevWeaponType    = -1;
        currentWeaponType = (int)RoomManager.Instance.DefaultWeaponType;
        VerifyNextWeapon();
        WeaponChanger component = GetComponent <WeaponChanger>();

        if (null != component)
        {
            component.Initialize(equipments);
        }
        SwapWeapon(initiallyDrawn: true);
        disableWingEffect();
    }
Example #4
0
        public static int SlotToIndex(TItem.SLOT slot)
        {
            switch (slot)
            {
                case TItem.SLOT.UPPER:
                    return 5;
                case TItem.SLOT.LOWER:
                    return 6;
                case TItem.SLOT.MELEE:
                    return 2;
                case TItem.SLOT.MAIN:
                    return 0;
                case TItem.SLOT.AUX:
                    return 1;
                case TItem.SLOT.BOMB:
                    return 3;
                case TItem.SLOT.HEAD:
                    return 4;
                case TItem.SLOT.FACE:
                    return 11;
                case TItem.SLOT.BACK:
                    return 10;
                case TItem.SLOT.LEG:
                    return 12;
                case TItem.SLOT.SASH1:
                    return 14;
                case TItem.SLOT.SASH2:
                    return 14;
                case TItem.SLOT.SASH3:
                    return 14;
                case TItem.SLOT.KIT:
                    return 13;
                case TItem.SLOT.LAUNCHER:
                    return 7;
                case TItem.SLOT.MAGAZINE_L:
                    return 8;
                case TItem.SLOT.MAGAZINE_R:
                    return 9;
                case TItem.SLOT.CHARACTER:
                    return 15;
            }

            return -1;
        }