예제 #1
0
    void OnTouchCheck(bool down, Vector2 stretch1Pos, Vector2 strech2Pos)
    {
        m_CircleArea.enabled = true;
        m_AreaCoroutine.Stop();
        if (down)
        {
            PostProcess_ScanCircle scan = GetComponentInChildren <PostProcess_ScanCircle>();
            Camera scanCamera           = scan.GetComponent <Camera>();
            if (scanCamera.InputRayCheck(stretch1Pos, out RaycastHit _hit))
            {
                scan.StartDepthScanCircle(_hit.point, 10f, 1f);
            }

            m_AreaRadius = 0f;
            m_AreaOrigin = Vector3.zero;
        }
        else
        {
            if (m_AreaRadius == 0)
            {
                return;
            }
            m_CircleArea.m_EffectData.m_Origin = m_AreaOrigin;
            m_AreaCoroutine.Start(TIEnumerators.ChangeValueTo((float value) => {
                m_CircleArea.m_EffectData.m_Radius = m_AreaRadius * value;
                m_CircleArea.OnValidate();
            }, 1, 0, .2f, () => { m_CircleArea.enabled = false; }));
        }
    }
예제 #2
0
 public void StartDepthScanCircle(Vector3 origin, float radius = 20, float duration = 1.5f)
 {
     if (m_ScanCoroutine == null)
     {
         m_ScanCoroutine = CoroutineHelper.CreateSingleCoroutine();
     }
     m_ScanCoroutine.Stop();
     enabled = true;
     m_EffectData.m_Origin = origin;
     m_ScanCoroutine.Start(TIEnumerators.ChangeValueTo((float value) => {
         m_EffectData.m_Elapse = radius * value;
         OnValidate();
     }, 0, 1, duration, () => { enabled = false; }));
 }