using System.Collections; using System.Collections.Generic; using System; using UnityEngine; using UnityEngine.UI; using GameFramework; using GameFramework.DataTable; using GameFramework.Resource; namespace MetaClient { public class UIAnimationMaker : UGuiForm { [SerializeField] [Header("模式类型")] protected EUIAnimationMakerStyple eUIAnimationMakerStyple = EUIAnimationMakerStyple.Senior; [SerializeField] [Header("旋转X或Y")] protected List rotateXY=new List(); protected Transform topView; protected Transform commonBtnView; protected Transform seniorView; protected Transform extraView; protected bool isPlay = false; protected GameObject zhenNumberItem;//帧数字 protected GameObject zhenBgItem;//帧背景 protected GameObject bodyZhenItem;//身体 protected GameObject zhenItem;//单位帧 protected Transform zhenBgList; protected Transform bodyZhenList; protected Transform zhenList; protected Text zhenTimeText; protected float nowTime = 0;//当前帧 protected float finalTime = 0;//末尾帧 protected float smallBiLi = 1; protected override void OnOpen(object userData) { base.OnOpen(userData); GameObject objItem = FindChildByName(this.gameObject.transform, "Item").gameObject; zhenNumberItem = objItem.transform.GetChild(0).gameObject; zhenBgItem = objItem.transform.GetChild(1).gameObject; bodyZhenItem = objItem.transform.GetChild(2).gameObject; zhenItem = objItem.transform.GetChild(3).gameObject; rotateXY.Add(FindChildByName(this.gameObject.transform,"RotateY")); rotateXY.Add(FindChildByName(this.gameObject.transform, "RotateX")); topView = FindChildByName(this.gameObject.transform, "Top"); ButtonFromTransform(topView.GetChild(0)).onClick.AddListener(SimpleFun); ButtonFromTransform(topView.GetChild(1)).onClick.AddListener(SeniorFun); ButtonFromTransform(topView.GetChild(2)).onClick.AddListener(SceneDressFun); ButtonFromTransform(topView.GetChild(3)).onClick.AddListener(ReturnFun); ButtonFromTransform(topView.GetChild(4)).onClick.AddListener(NightLighting); ButtonFromTransform(topView.GetChild(4)).onClick.AddListener(SunLighting); ButtonFromTransform(topView.GetChild(5)).onClick.AddListener(HalfLighting); commonBtnView = FindChildByName(this.gameObject.transform,"CommonButton"); ButtonFromTransform(commonBtnView.GetChild(0)).onClick.AddListener(SaveBtnFun); ButtonFromTransform(commonBtnView.GetChild(1)).onClick.AddListener(MusicBtnFun); ButtonFromTransform(commonBtnView.GetChild(2)).onClick.AddListener(FullScreenBtnFun); ButtonFromTransform(commonBtnView.GetChild(2)).onClick.AddListener(PlayBtnFun); Transform bottomBg = FindChildByName(this.gameObject.transform, "BottomBg"); ButtonFromTransform(bottomBg.GetChild(0)).onClick.AddListener(StartKBtnFun); ButtonFromTransform(bottomBg.GetChild(1)).onClick.AddListener(EndKBtnFun); ButtonFromTransform(bottomBg.GetChild(3)).onClick.AddListener(DelectBtnFun); ButtonFromTransform(bottomBg.GetChild(4)).onClick.AddListener(CopyBtnFun); ButtonFromTransform(bottomBg.GetChild(5)).onClick.AddListener(NextKBtnFun); ButtonFromTransform(bottomBg.GetChild(6)).onClick.AddListener(LastKBtnFun); zhenTimeText = bottomBg.GetChild(7).GetChild(0).gameObject.GetComponent(); zhenTimeText.text = nowTime+""; //FindButtonByName(this.gameObject.transform, "BackBtn").onClick.AddListener(SaveBtnFun); //FindButtonByName(this.gameObject.transform, "MusicBtn").onClick.AddListener(MusicBtnFun); //FindButtonByName(this.gameObject.transform, "FullScreenBtn").onClick.AddListener(FullScreenBtnFun); //FindButtonByName(this.gameObject.transform, "PlayBtn").onClick.AddListener(PlayBtnFun); seniorView = FindChildByName(this.gameObject.transform, "Senior"); extraView = FindChildByName(this.gameObject.transform, "Extra"); } protected void SceneDressFun() { } protected void ReturnFun() { } protected void SimpleFun() { } protected void SeniorFun() { } protected void CreateZhenListFun() { } /// /// 保存按钮 /// protected void SaveBtnFun() { } /// /// 音乐按钮 /// protected void MusicBtnFun() { } /// /// 全屏按钮 /// protected void FullScreenBtnFun() { } /// /// 播放按钮 /// protected void PlayBtnFun() { isPlay = !isPlay; GameObject saveObj = commonBtnView.GetChild(3).gameObject; saveObj.transform.GetChild(1).gameObject.SetActive(isPlay); saveObj.transform.GetChild(2).gameObject.SetActive(!isPlay); // Transform commonButtonRight = FindChildByName(this.gameObject.transform, "CommonButton"); } /// /// 捏脸按钮 /// protected void NieLianFun() { } /// /// 摄像机按钮 /// protected void CameraBtnFun() { } protected void DelectBtnFun() { } protected void CopyBtnFun() { } protected void StartKBtnFun() { } protected void EndKBtnFun() { } /// /// 下一帧 /// protected void NextKBtnFun() { if (isPlay) { return; } nowTime += 1; } /// /// 上一帧 /// protected void LastKBtnFun() { if (isPlay) { return; } if (nowTime <= 1) { return; } nowTime -= 1; } /// /// 下十帧 /// protected void NextTenKBtnFun() { if (isPlay) { return; } nowTime += 10; } /// /// 上十帧 /// protected void LastTenKBtnFun() { if (isPlay) { return; } if (nowTime < 10) { return; } nowTime -= 10; } /// ///旋转X轴 /// public void RotateXFun() { } /// /// 旋转Y轴 /// public void RotateYFun() { } /// /// 移动 /// public void MoveFun() { } /// ///摄像机 /// public void CameraFun() { } /// /// 捏脸 /// public void NeiLianFun() { } /// ///夜晚灯光 /// protected void NightLighting() { } /// ///白天灯光 /// protected void SunLighting() { } /// ///中午灯光 /// protected void HalfLighting() { } protected override void OnClose(bool isShutdown, object userData) { base.OnClose(isShutdown, userData); } public Button ButtonFromTransform(Transform trans) { if (trans.gameObject.GetComponent