private void OnPressKeyZ() { SoundManager.GetInstance().Play("se_selectok", Consts.DefaultUISEVolume, false, false); SelCharacterData data = _charDatas[_selectIndex]; CommandManager.GetInstance().RunCommand(CommandConsts.SelectCharacter, data.index); }
public SelectCharView() { _charDatas = new List <SelCharacterData>(); SelCharacterData data; data = new SelCharacterData { spName = "ReimuCG", desSp = "ReimuDes", index = 0, }; _charDatas.Add(data); data = new SelCharacterData { spName = "MarisaCG", desSp = "MarisaDes", index = 1, }; _charDatas.Add(data); }
/// <summary> /// 设置主界面当前选中的选项 /// </summary> /// <param name="index"></param> private void SetSelectIndex(int index, int appearDir) { _selectIndex = index; SelCharacterData data = _charDatas[_selectIndex]; _charCGImg.sprite = ResourceManager.GetInstance().GetSprite("SelCharView", data.spName); _charDesImg.sprite = ResourceManager.GetInstance().GetSprite("SelCharView", data.desSp); if (appearDir == Consts.DIR_NULL) { _viewState = eViewState.Wait; _stateTime = 0; } else { TweenRotation tween0 = TweenManager.GetInstance().Create <TweenRotation>(); tween0.SetParas(_charDesTf.gameObject, 0, 30, ePlayMode.Once); TweenAnchoredPos tween1 = TweenManager.GetInstance().Create <TweenAnchoredPos>(); tween1.SetParas(_charCGTf.gameObject, 0, 30, ePlayMode.Once); if (appearDir == Consts.DIR_LEFT) { _charDesTf.localEulerAngles = new Vector3(0, 270, 0); tween0.SetParas(new Vector3(0, 360, 0), InterpolationMode.Linear); _charCGTf.anchoredPosition = CGLeftAppearPos; } else { _charDesTf.localEulerAngles = new Vector3(0, 90, 0); tween0.SetParas(Vector3.zero, InterpolationMode.Linear); _charCGTf.anchoredPosition = CGRightAppearPos; } tween1.SetParas(CGDefaultPos, InterpolationMode.EaseInQuad); tween1.SetFinishCallBack(SelCharTweenCallback); TweenManager.GetInstance().AddTween(tween0); TweenManager.GetInstance().AddTween(tween1); _viewState = eViewState.ChangeCharAni; } }