Exemple #1
0
 /// <summary>
 /// 关闭focus
 /// </summary>
 /// <param name="_notif"></param>
 private void TurnOffFocus(Anywhere.Notification _notif)
 {
     trackingInitialized = false;
     SquareState         = FocusState.Putdown;
     this.gameObject.SetActive(false);
     StopCoroutine(m_FocusCoroutine);
 }
Exemple #2
0
    /// <summary>
    /// 开启focus
    /// </summary>
    /// <param name="_notif"></param>
    private void TurnOnFocus(Anywhere.Notification _notif)
    {
        m_ShowedButton      = false;
        trackingInitialized = true;
        SquareState         = FocusState.Initializing;

        this.gameObject.SetActive(true);
        StartCoroutine(m_FocusCoroutine);
    }
Exemple #3
0
    /// <summary>
    /// 将内容的位置与focus的位置进行同步
    /// </summary>
    /// <param name="_notif"></param>
    private void SyncFocusPosToContent(Anywhere.Notification _notif)
    {
        //Vector3 focusPos = foundSquare.transform.position;
        Vector3    dir     = Camera.main.transform.position - foundSquare.transform.position;
        Quaternion newQuat = Quaternion.LookRotation(dir);

        newQuat.x = newQuat.z = 0;
        ContentPlaceHelper cph = new ContentPlaceHelper
        {
            //Camera.main.transform.rotation
            m_ContentPos      = foundSquare.transform.localPosition,
            m_ContentRot      = newQuat,
            m_FocusGameObject = this.gameObject
        };

        Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.OPERATER_PLACECONTENT, cph);
        Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.ARKIT_FOCUS_OFF);
    }