public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        GrenadeThrower gt = (GrenadeThrower)target;

        GUILayout.BeginHorizontal();

        gt.throwForce = EditorGUILayout.Slider("Throw force", gt.throwForce, .1f, 500f);

        if (GUILayout.Button("Throw"))
        {
            gt.Throw();
        }
        GUILayout.EndHorizontal();
    }
Example #2
0
 private void WeaponSelection(bool state)
 {
     if (state)
     {
         isSwitching = false;
     }
     else if (!weaponHidden)
     {
         if (grenadeThrowing)
         {
             grenadeThrower.Throw();
             grenadeThrowing = false;
             StartCoroutine(SelectWeapon(grenadeThrower.throwingTime + 0.2f));
         }
         else
         {
             StartCoroutine(SelectWeapon());
         }
     }
 }