Exemplo n.º 1
0
        public static ConfigAvatarShowInfo GetAvatarShowInfo(AvatarDataItem avatar, MiscData.PageInfoKey pageKey, string tabName)
        {
            ConfigTabAvatarTransformInfo info2;
            ConfigPageAvatarShowInfo     pageAvatarShowInfo = MiscData.GetPageAvatarShowInfo(pageKey);
            string avatarRegistryKey = avatar.AvatarRegistryKey;

            char[] separator = new char[] { '_' };
            string key       = avatarRegistryKey.Split(separator)[0];

            if (pageAvatarShowInfo.AvatarTabTransformInfos.ContainsKey(avatarRegistryKey))
            {
                info2 = pageAvatarShowInfo.AvatarTabTransformInfos[avatarRegistryKey];
            }
            else if (pageAvatarShowInfo.AvatarTabTransformInfos.ContainsKey(key))
            {
                info2 = pageAvatarShowInfo.AvatarTabTransformInfos[key];
            }
            else
            {
                info2 = pageAvatarShowInfo.AvatarTabTransformInfos["Default"];
            }
            string str3 = tabName + "_" + avatar.avatarID;

            if (info2.AvatarShowInfos.ContainsKey(str3))
            {
                return(info2.AvatarShowInfos[str3]);
            }
            if (info2.AvatarShowInfos.ContainsKey(tabName))
            {
                return(info2.AvatarShowInfos[tabName]);
            }
            return(info2.AvatarShowInfos["Default"]);
        }
Exemplo n.º 2
0
        public static void SetCameraLookAt(AvatarDataItem avatar, MiscData.PageInfoKey pageKey, string tabName)
        {
            ConfigAvatarShowInfo info      = GetAvatarShowInfo(avatar, pageKey, tabName);
            Transform            transform = GameObject.Find("LookAt").transform;

            transform.position    = info.LookAt.Position;
            transform.eulerAngles = info.LookAt.EulerAngle;
        }
Exemplo n.º 3
0
        public static void Create3DAvatarByPage(AvatarDataItem avatar, MiscData.PageInfoKey pageKey, string tabName = "Default")
        {
            ConfigPageAvatarShowInfo     pageAvatarShowInfo = MiscData.GetPageAvatarShowInfo(pageKey);
            ConfigAvatarShowInfo         info2 = GetAvatarShowInfo(avatar, pageKey, tabName);
            List <Avatar3dModelDataItem> body  = new List <Avatar3dModelDataItem> {
                new Avatar3dModelDataItem(avatar, info2.Avatar.Position, info2.Avatar.EulerAngle, pageAvatarShowInfo.ShowLockViewIfLock)
            };

            Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.CreateAvatarUIModels, body));

            GameObject obj2 = GameObject.Find("LookAt");

            if (obj2 != null)
            {
                obj2.transform.position    = info2.LookAt.Position;
                obj2.transform.eulerAngles = info2.LookAt.EulerAngle;
            }
        }
Exemplo n.º 4
0
 public void StartAutoRotateModel(AvatarModelAutoRotateType rotateType, MiscData.PageInfoKey pageKey = 3, string tabName = "Default")
 {
     if (rotateType == AvatarModelAutoRotateType.RotateToFront)
     {
         Vector3 forward = GameObject.Find("MainCamera").transform.forward;
         this._autoRotateTargetDirection = new Vector3(-forward.x, 0f, -forward.z);
     }
     else if (rotateType == AvatarModelAutoRotateType.RotateToBack)
     {
         Vector3 vector2 = GameObject.Find("MainCamera").transform.forward;
         this._autoRotateTargetDirection = new Vector3(vector2.x, 0f, vector2.z);
     }
     else if (rotateType == AvatarModelAutoRotateType.RotateToOrigin)
     {
         ConfigAvatarShowInfo info     = UIUtil.GetAvatarShowInfo(this._avatarDataItem, pageKey, tabName);
         Quaternion           identity = Quaternion.identity;
         identity.eulerAngles            = info.Avatar.EulerAngle;
         this._autoRotateTargetDirection = (Vector3)(identity * Vector3.forward);
     }
     this._currentAutoRotateSpeed = this.maxAutoRotateSpeed;
     this._inAutoRotate           = true;
 }