public void OnTriggerKeep(TriggerEvent evt) { }
public virtual void OnTriggerKeep(TriggerEvent evt) { }
public void OnTriggerOut(TriggerEvent evt) { }
public virtual void OnTriggerOut(TriggerEvent evt) { }
// 进入触发器 add by TangJian 2017/07/27 17:52:41 public void OnTriggerEnter(Collider other) { if (triggerMode == TriggerMode.Default) { if (isReady == false) { return; } if (TagTriggerManager.Instance.FindTirggerBool(this.gameObject.tag, other.gameObject.tag)) { //Debug.Log("OnTriggerEnter"); TriggerController otherTriggerController = other.gameObject.GetComponent <TriggerController>(); // 记录触发器 add by TangJian 2018/12/2 15:41 TriggerManager.Instance.AddRecord(this, otherTriggerController); // 获取双方代理 add by TangJian 2019/3/19 18:21 ITriggerDelegate selfITriggerDelegate = ITriggerDelegate; ITriggerDelegate otherITriggerDelegate = otherTriggerController.ITriggerDelegate; // 获得碰撞位置 add by TangJian 2019/3/19 18:21 Bounds inbounds = other.bounds.IntersectsExtend(triggerCollider.bounds); Vector3 collidePoint = inbounds.center; // 组织触发器事件 add by TangJian 2019/3/19 18:22 TriggerEvent triggerEvent = new TriggerEvent(); triggerEvent.type = TriggerEventType.NewTrigger; triggerEvent.colider = other; triggerEvent.colidePoint = collidePoint; triggerEvent.selfTriggerController = this; triggerEvent.otherTriggerController = otherTriggerController; // if (other.gameObject.tag == gameObject.tag&& other.gameObject.GetComponentInParent<RoleController>().RoleData.AttrData.isCrash) // { // gameObject.GetComponent<Rigidbody>().AddForce(collidePoint-gameObject.GetComponent<Collider>().bounds.center); // } if (selfITriggerDelegate != null) { selfITriggerDelegate.OnTriggerIn(triggerEvent); } if (OnTriggerInEvent != null) { OnTriggerInEvent(triggerEvent); } } } else if (triggerMode == TriggerMode.Transmit) { TriggerEvent triggerEvent = new TriggerEvent(); triggerEvent.colider = other; if (ITriggerDelegate != null) { ITriggerDelegate.OnTriggerIn(triggerEvent); if (OnTriggerInEvent != null) { OnTriggerInEvent(triggerEvent); } } } }
public void OnTriggerIn(TriggerEvent evt) { }
public void OnTriggerOut(TriggerEvent evt) { //throw new System.NotImplementedException(); }
public override void OnTriggerIn(TriggerEvent evt) { }