protected virtual void ApplyAfterLayerCheck(GameObject other) { if (LayerTools.IsLayerInMask(LayerMask, other.layer) == false) { return; } Apply(other.gameObject); }
protected override void OnTriggerStay(Collider other) { if (LayerTools.IsLayerInMask(LayerMask, other.gameObject.layer) == false) { return; } Apply(other.gameObject); }
protected virtual void OnTriggerEnter(Collider other) { if (LayerTools.IsLayerInMask(Mask, other.gameObject.layer) == false) { return; } DeployEffectZone(); HandlePenetration(); }
private void OnCollisionEnter2D(Collision2D other) { if (LayerTools.IsLayerInMask(bounceLayer, other.gameObject.layer) == false) { return; } ActivateBounce(); //if (myBody.velocity.magnitude >= 5f) // bounceForce = startingForce; }
protected override void OnTriggerStay(Collider other) { if (LayerTools.IsLayerInMask(LayerMask, other.gameObject.layer) == false) { return; } if (CheckHitTargets(other.gameObject) == true) { Apply(other.gameObject); } }
private void OnCollisionEnter(Collision other) { if (LayerTools.IsLayerInMask(groundLayer, other.gameObject.layer) == false) { return; } //Debug.Log("Collided with ground"); if (onCollideWithGround != null) { onCollideWithGround(); } }
private void SetDestination() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, Mathf.Infinity)) { if (hit.collider != null) { if (LayerTools.IsLayerInMask(walkableArea, hit.collider.gameObject.layer)) { navMeshAgent.SetDestination(hit.point); } } } }
protected virtual void ApplyAfterLayerCheck(GameObject other, bool checkHits = false) { if (LayerTools.IsLayerInMask(LayerMask, other.layer) == false) { return; } if (checkHits == true) { if (CheckHitTargets(other) == false) { return; } } Apply(other.gameObject); }
private GameObject TryToDetect(GameObject other) { Vector2 direction = other.transform.position - transform.position; RaycastHit2D hit = Physics2D.Raycast(transform.position, direction.normalized, detectionDistance); if (hit.collider != null) { //Debug.Log(hit.collider.gameObject.name + " is seen"); if (LayerTools.IsLayerInMask(targetLayers, hit.collider.gameObject.layer) == true) { //Debug.Log(hit.collider.gameObject.name + " is seen"); return(hit.collider.gameObject); } } return(null); }
private void OnTriggerStay2D(Collider2D other) { if (LayerTools.IsLayerInMask(targetLayers, other.gameObject.layer) == false) { return; } GameObject target = TryToDetect(other.gameObject); if (target != null) { if (targets.AddUnique(target)) { owner.Brain.TargetSpotted(); } //if (targets.AddUnique(target)) //{ // ((EntityEnemy)owner).Aggro(); //} } }