public override void OnInspectorGUI() { Tapestry_ItemWeaponMelee w = target as Tapestry_ItemWeaponMelee; if (ReferenceEquals(w.effectStanding, null)) { w.effectStanding = (Tapestry_Effect)ScriptableObject.CreateInstance("Tapestry_Effect"); } if (ReferenceEquals(w.effectStanding.payload, null)) { w.effectStanding.payload = (Tapestry_EffectBuilder_Payload)ScriptableObject.CreateInstance("Tapestry_EffectBuilder_Payload_Damage"); } if (startup) { pSel = ArrayUtility.IndexOf(Tapestry_Config.GetPayloadTypes().Values.ToArray(), w.effectStanding.payload.GetType()); startup = false; } GUILayout.BeginVertical("box"); pSel = w.effectStanding.DrawInspector(pSel); GUILayout.EndVertical(); base.OnInspectorGUI(); }
private void HandleHeldItemUse(bool fwd, bool rev, bool lft, bool rgt, bool lmb, bool rmb) { if (!isHeldItemsHidden && lmb) { if (holdContainerLeft.transform.childCount != 0) { Transform heldTransform = holdContainerLeft.transform.GetChild(0); if (heldTransform.gameObject.GetComponent <Tapestry_ItemWeaponMelee>() != null) { Tapestry_ItemWeaponMelee held = heldTransform.gameObject.GetComponent <Tapestry_ItemWeaponMelee>(); held.AttackStanding(); } } } }