コード例 #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
ファイル: UIWorldBase.cs プロジェクト: striter/VDefend
 public virtual void Init(bool useAnim)
 {
     if (rtf_Canvas)
     {
         return;
     }
     rtf_Canvas   = transform.Find("Canvas").GetComponent <RectTransform>();
     tf_Container = rtf_Canvas.transform.Find("Container");
     if (useAnim)
     {
         this.StartSingleCoroutine(0, TIEnumerators.ChangeValueTo((float value) => { tf_Container.localScale = Vector3.one * value; }, 0, 1, .5f));
     }
 }
コード例 #3
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; }));
 }
コード例 #4
0
    protected void Play(bool useAnim)
    {
        m_Animating = useAnim;
        if (!useAnim)
        {
            return;
        }

        m_AnimateStartPos = rtf_Container.anchoredPosition + Vector2.up * Screen.height;
        m_AnimateEndPos   = rtf_Container.anchoredPosition;
        this.StartSingleCoroutine(0, TIEnumerators.ChangeValueTo((float value) => {
            rtf_Container.anchoredPosition = Vector2.Lerp(m_AnimateStartPos, m_AnimateEndPos, value);
        }
                                                                 , 0f, 1f, F_AnimDuration, null, false));
    }
コード例 #5
0
    public void StartAreaScan(Vector3 startPoint, Color scanColor, Texture scanTex = null, float scale = 1f, float lerp = .7f, float width = 1f, float range = 20, float duration = 1.5f)
    {
        if (GetCameraEffect <PE_AreaScanDepth>() != null)
        {
            RemoveCameraEffect <PE_AreaScanDepth>();
        }

        PE_AreaScanDepth areaScan = GetOrAddCameraEffect <PE_AreaScanDepth>();

        areaScan.SetEffect(startPoint, scanColor, scanTex, scale, lerp, width);
        this.StartSingleCoroutine(0, TIEnumerators.ChangeValueTo((float value) => {
            areaScan.SetElapse(range * value);
        }, 0, 1, duration, () => {
            RemoveCameraEffect <PE_AreaScanDepth>();
        }));
    }
コード例 #6
0
 protected virtual void OnCancelBtnClick()
 {
     if (btn_ContainerCancel)
     {
         btn_ContainerCancel.enabled = false;
     }
     if (btn_WholeCancel)
     {
         btn_WholeCancel.enabled = false;
     }
     if (!m_Animating)
     {
         OnHideFinished();
         return;
     }
     this.StartSingleCoroutine(0, TIEnumerators.ChangeValueTo((float value) => {
         rtf_Container.anchoredPosition = Vector2.Lerp(m_AnimateStartPos, m_AnimateEndPos, value);
     }, 1f, 0f, F_AnimDuration, OnHideFinished, false));
 }
コード例 #7
0
 protected virtual void OnCancelBtnClick()
 {
     if (btn_ContainerCancel)
     {
         btn_ContainerCancel.enabled = false;
     }
     if (btn_WholeCancel)
     {
         btn_WholeCancel.enabled = false;
     }
     if (!m_Animating)
     {
         OnPageExit(this);
         return;
     }
     m_AnimationCoroutine.Start(TIEnumerators.ChangeValueTo((float value) => {
         rtf_Container.anchoredPosition = Vector2.Lerp(m_AnimateStartPos, m_AnimateEndPos, value);
     }, 1f, 0f, F_AnimDuration, () => { OnPageExit(this); }, false));
 }
コード例 #8
0
    public virtual void OnPlay(bool doAnim, Action <UIPageBase> OnPageExit)
    {
        m_Animating     = doAnim;
        this.OnPageExit = OnPageExit;
        if (btn_ContainerCancel)
        {
            btn_ContainerCancel.enabled = true;
        }
        if (btn_WholeCancel)
        {
            btn_WholeCancel.enabled = true;
        }

        if (!doAnim)
        {
            return;
        }
        m_AnimationCoroutine.Start(TIEnumerators.ChangeValueTo((float value) => {
            rtf_Container.anchoredPosition = Vector2.Lerp(m_AnimateStartPos, m_AnimateEndPos, value);
        }
                                                               , 0f, 1f, F_AnimDuration, null, false));
    }
コード例 #9
0
 void HideTitle()
 {
     this.StartSingleCoroutine(0, TIEnumerators.RectTransformLerpTo(RectTrans, endPos, startPos, 2f, null));
 }
コード例 #10
0
 void PauseTitle()
 {
     this.StartSingleCoroutine(0, TIEnumerators.PauseDel(2, HideTitle));
 }
コード例 #11
0
 public void ShowTitle(string text, float duration)
 {
     Title.text = text;
     this.StartSingleCoroutine(0, TIEnumerators.RectTransformLerpTo(RectTrans, startPos, endPos, 2f, PauseTitle));
 }