//**********************************************************************************//
    // EQUIP WEAPON TEXT																//
    // show/hide text collected by FindTarget.cs and the sprite button                  //
    //**********************************************************************************//
    public void ShowEquipText(string name, vMeleeWeapon.MeleeType meleeType, int side)
    {
        if (showEquipText)
        {
            return;
        }
        showEquipText = true;

        if (meleeType == vMeleeWeapon.MeleeType.All)
        {
            equipLeftIcon.sprite   = controllerInput ? j_leftSideButton : k_leftSideButton;
            equipRightIcon.sprite  = controllerInput ? j_rightSideButton : k_rightSideButton;
            equipLeftIcon.enabled  = (side == -1 || side == 2);
            equipRightIcon.enabled = (side == 1 || side == 2);
        }
        else if (meleeType == vMeleeWeapon.MeleeType.Attack)
        {
            equipRightIcon.sprite  = controllerInput ? j_rightSideButton : k_rightSideButton;
            equipRightIcon.enabled = (side == 1 || side == 2);
        }
        else
        {
            equipLeftIcon.sprite  = controllerInput ? j_leftSideButton : k_leftSideButton;
            equipLeftIcon.enabled = (side == -1 || side == 2);
        }

        equipText.enabled = true;
        equipText.text    = name;
    }
Ejemplo n.º 2
0
    void OnGUI()
    {
        if (!skin)
        {
            skin = Resources.Load("skin") as GUISkin;
        }
        GUI.skin          = skin;
        this.minSize      = rect;
        this.titleContent = new GUIContent("Melee Weapon", null, "Equipment Creator");

        GUILayout.BeginVertical("Melee Creator Window", "window");
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        GUILayout.BeginVertical("box");
        equipmentType = (vMeleeWeapon.MeleeType)EditorGUILayout.EnumPopup("Melee Type", equipmentType);

        buttomRect          = GUILayoutUtility.GetLastRect();
        buttomRect.position = new Vector2(0, buttomRect.position.y);
        buttomRect.width    = this.maxSize.x;

        equipModel = EditorGUILayout.ObjectField("FBX Model", equipModel, typeof(GameObject), true, GUILayout.ExpandWidth(true)) as GameObject;

        if (GUI.changed && equipModel != null)
        {
            fbxPreview = Editor.CreateEditor(equipModel);
        }

        EditorGUILayout.Space();
        GUILayout.EndVertical();
        if (equipModel != null)
        {
            DrawHumanoidPreview();
            GUILayout.BeginHorizontal("box");
            equipmentName = EditorGUILayout.TextField("Melee Weapon Name", equipModel.gameObject.name);
            GUILayout.EndVertical();

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Create"))
            {
                CreateMeleeWeapon();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }

        GUILayout.EndVertical();
    }
 bool checkWeaponType(vMeleeWeapon m_weapon, vMeleeWeapon.MeleeType type)
 {
     return(m_weapon.meleeType == vMeleeWeapon.MeleeType.All || m_weapon.meleeType == type);
 }