示例#1
0
        private void UpdateRootPos()
        {
            Vector3 pos;
            Vector3 scrPos   = new Vector3(Screen.width, Screen.height, 0);
            Vector3 worldPos = scrPos; //SceneBoot.Instance.UICamera.ScreenToWorldPoint(scrPos);
            float   x        = Screen.width / 4;
            float   x1       = Screen.width / 3;

            switch (m_Seat)
            {
            case 0:
                //pos = new Vector3(x, Camera.main.rect.yMin*Screen.height, 0);
                pos = new Vector3(x, 0, 0);
                break;

            case 1:
                pos = new Vector3(x1 * 2, Camera.main.rect.yMin * Screen.height, 0);
                break;

            case 2:
                pos = new Vector3(x1 * 2, Camera.main.rect.yMax * Screen.height, 0);
                break;

            case 3:
                pos = new Vector3(x, Camera.main.rect.yMax * Screen.height, 0);
                break;

            default:
                pos = Vector3.zero;
                break;
            }

            m_TransformHandle.position = pos;//SceneObjMgr.Instance.UICamera.ScreenToWorldPoint(pos);
            // new Vector3(-1, 0, 0);
            LauncherPos = new Vector2(m_TransformHandle.position.x, m_TransformHandle.position.y);
            //Transform goldIcon = m_TransformHandle.FindChild("UserScore/Image");
            Transform goldIcon = m_TransformHandle.FindChild("UserScore/Image");

            SceneRuntime.InitGoldPosMapping(m_Seat, goldIcon.position);
            // m_GlodPos = m_GlodTransform.position;
            //m_GunPivot = Camera.main.ScreenToWorldPoint( m_GunBarrel.GunPivot);
            m_GunPivot = m_TransformHandle.position;//m_GunBarrel.GunPivot;
        }