Пример #1
0
        private void PlaceContent(Notification _notif)
        {
            ContentPlaceHelper cph = _notif.param as ContentPlaceHelper;

            m_Content.transform.localPosition = cph.m_ContentPos;
            m_Content.transform.rotation      = cph.m_ContentRot;
            m_Content.SetActive(true);
        }
Пример #2
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);
    }