예제 #1
0
 public void Start()
 {
     OnCorection?.Invoke();
     OnDetect?.Invoke();
     OnResize?.Invoke();
     OnCompare?.Invoke();
     pi.Save(procededImagesSavePath);
 }
예제 #2
0
 public void EnterAttention()
 {
     if (!litManager.IsLit || hideablePlayer.Hidden)
     {
         return;
     }
     onDetect.Invoke();
 }
예제 #3
0
 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);
    }
예제 #5
0
        private void EnterDetect(GameObject objectInAttention)
        {
            Vector3 effectLocation = objectInAttention.transform.position;
            Vector3 directionRay   = transform.position - effectLocation;

            enterDetectEffect?.Play(effectLocation, directionRay);

            onDetect.Invoke();
            SetDetectedState(true);
        }
예제 #6
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag != target)
        {
            return;
        }

        currentCollisions.Add(other.gameObject);

        onDetect?.Invoke(currentCollisions);
    }
예제 #7
0
    // 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();
    }
예제 #8
0
        void LateUpdate()
        {
            if (pause.IsPaused)
            {
                return;
            }

            GameObject player = TestConeAccurate();

            if (player != null)
            {
                onDetect.Invoke();
            }
        }
예제 #9
0
        public void StayAttention(GameObject objectInAttention)
        {
            if (PlayerIsUndetectable())
            {
                ExitAttention(objectInAttention);
                return;
            }

            if (detectedLastFrame)
            {
                onDetectStay.Invoke();
                return;
            }

            EnterDetect(objectInAttention);
        }
예제 #10
0
 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();
     }
 }
예제 #11
0
 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);
             }
         }
     }
 }
예제 #12
0
 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);
             }
         }
     }
 }