浏览代码

Small Fixes + Added Tag Check

/fix-pickups
Thomas ICHÉ 3 年前
当前提交
79e5ed8b
共有 4 个文件被更改,包括 20 次插入9 次删除
  1. 2
      Editor/Pickup/PickupItemEditor.cs
  2. 2
      Runtime/Ingredients/Pickup/PickupEffectBase.cs
  3. 3
      Runtime/Ingredients/Pickup/PickupItem.cs
  4. 22
      Runtime/Ingredients/Pickup/PickupOwnerBase.cs

2
Editor/Pickup/PickupItemEditor.cs


GUILayout.FlexibleSpace();
});
EditorGUILayout.HelpBox("Add Effects to the Pickup Item by adding Pickup Effect Components to this Game Object", MessageType.Info);
EditorGUILayout.HelpBox("Add Pickup Effect components to this Game Object to see them appear in the list here", MessageType.Info);
m_RList.DoLayoutList();

2
Runtime/Ingredients/Pickup/PickupEffectBase.cs


namespace GameplayIngredients.Pickup
{
[HelpURL(Help.URL + "pickup")]
public abstract class PickupEffectBase : MonoBehaviour
public abstract class PickupEffectBase : GameplayIngredientsBehaviour
{
public abstract void ApplyPickupEffect(PickupOwnerBase owner);
}

3
Runtime/Ingredients/Pickup/PickupItem.cs


private void OnTriggerEnter(Collider other)
{
var owner = other.gameObject.GetComponent<PickupOwnerBase>();
if(owner != null)
if(other.gameObject.TryGetComponent(out PickupOwnerBase owner))
{