浏览代码

add trigger stay and disable tag field if not used

/main
Laurent 5 年前
当前提交
9c45d90f
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16
      Runtime/LevelScripting/Events/OnTriggerEvent.cs

16
Runtime/LevelScripting/Events/OnTriggerEvent.cs


[ReorderableList]
public Callable[] onTriggerExit;
[ReorderableList]
public Callable[] onTriggerStay;
[EnableIf("OnlyInteractWithTag")]
public string Tag = "Player";
private void OnTriggerEnter(Collider other)

if (!OnlyInteractWithTag)
{
Callable.Call(onTriggerExit, other.gameObject);
}
}
private void OnTriggerSta(Collider other)
{
if (OnlyInteractWithTag && other.tag == Tag)
{
Callable.Call(onTriggerStay, other.gameObject);
}
if (!OnlyInteractWithTag)
{
Callable.Call(onTriggerStay, other.gameObject);
}
}
}
正在加载...
取消
保存