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; }
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; } }
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; }