public void Start() { OnCorection?.Invoke(); OnDetect?.Invoke(); OnResize?.Invoke(); OnCompare?.Invoke(); pi.Save(procededImagesSavePath); }
public void EnterAttention() { if (!litManager.IsLit || hideablePlayer.Hidden) { return; } onDetect.Invoke(); }
public void ExitAttention(GameObject objectInAttention) { if (!detectedLastFrame) { return; } onDetectLoss.Invoke(); SetDetectedState(false); }
private void OnTriggerEnter(Collider other) { if (other.tag != target) { return; } onDetect?.Invoke(other.gameObject); }
private void EnterDetect(GameObject objectInAttention) { Vector3 effectLocation = objectInAttention.transform.position; Vector3 directionRay = transform.position - effectLocation; enterDetectEffect?.Play(effectLocation, directionRay); onDetect.Invoke(); SetDetectedState(true); }
private void OnTriggerEnter(Collider other) { if (other.tag != target) { return; } currentCollisions.Add(other.gameObject); onDetect?.Invoke(currentCollisions); }
// Detect the destination. public void Detect() { RaycastHit hit; if (Physics.Raycast(_transform.position, _direction, out hit, _distance, 1 << 10) && hit.collider.gameObject.CompareTag("LandScape")) { _destination = new Vector3(hit.point.x, 0, hit.point.z); } else { _destination = _transform.position + _distance * _direction.normalized; } OnDetect?.Invoke(); }
void LateUpdate() { if (pause.IsPaused) { return; } GameObject player = TestConeAccurate(); if (player != null) { onDetect.Invoke(); } }
public void StayAttention(GameObject objectInAttention) { if (PlayerIsUndetectable()) { ExitAttention(objectInAttention); return; } if (detectedLastFrame) { onDetectStay.Invoke(); return; } EnterDetect(objectInAttention); }
public void CheckDetection() { if (hitHurtables.Count > 0) { for (int i = 0; i < hitHurtables.Count; i++) { IHurtable ih = hitHurtables[i].GetComponent <IHurtable>(); if (ignoreList.Contains(ih)) { continue; } ignoreList.Add(ih); OnDetect?.Invoke(hitHurtables[i]); } hitHurtables.Clear(); } }
void OnTriggerExit(Collider other) { if (other.gameObject == ignoreObject) { return; } if (detectLayers.Contains(other.gameObject.layer)) { if (detectTags.Count == 0 || (detectTags.Count > 0 && detectTags.Contains(other.gameObject.tag))) { detected.Remove(other.gameObject); if (OnDetectExit != null) { OnDetectExit.Invoke(other.gameObject); } } } }
private void OnTriggerStay(Collider other) { if (other.gameObject == ignoreObject) { return; } if (detectLayers.Contains(other.gameObject.layer)) { if (detectTags.Count == 0 || (detectTags.Count > 0 && detectTags.Contains(other.gameObject.tag))) { var pos = other.transform.parent != null ? other.transform.parent.position : other.transform.position; Debug.DrawLine(transform.parent.position, pos, Color.magenta); if (OnDetectStay != null) { OnDetectStay.Invoke(other.gameObject); } } } }