protected override void RenderThrowDice() { //base.RenderThrowDice(); // 1.0 伸手 Tween t = _rhand.transform.DOLocalMove(new Vector3(0.173f, -1.91f, 1.841f), _diushaizishendelta); Animator animator = _rhand.GetComponent <Animator>(); Sequence mySequence = DOTween.Sequence(); mySequence.Append(t) .AppendCallback(() => { // 2.0 Bacon.GL.Game.Hand hand = _rhand.GetComponent <Bacon.GL.Game.Hand>(); hand.Rigster(Bacon.GL.Game.Hand.EVENT.DIUSHAIZI_COMPLETED, () => { // 3.1 UnityEngine.Debug.Log("left diu saizi "); ((GameController)_controller).RenderThrowDice(_d1, _d2); // 3.2 Tween t32 = _rhand.transform.DOLocalMove(_rhandinitpos, _diushaizishoudelta); Sequence mySequence32 = DOTween.Sequence(); mySequence32.Append(t32) .AppendCallback(() => { animator.SetBool("Idle", true); }); }); animator.SetBool("Diushaizi", true); }); }
protected override void RenderThrowDice() { // 1.0 伸手 Animator animator = _rhand.GetComponent <Animator>(); Tween t; if (_sex == 1) { Vector3 dst = new Vector3(1.858f, -1.914f, 1.799f); Vector3 offset = dst - _rhandinitpos; Vector3[] path = new Vector3[] { _rhandinitpos, _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.1f, _rhandinitpos.y, _rhandinitpos.z + offset.z * 0.1f), _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.2f, _rhandinitpos.y, _rhandinitpos.z + offset.z * 0.2f), _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.4f, _rhandinitpos.y, _rhandinitpos.z + offset.z * 0.4f), _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.6f, _rhandinitpos.y + offset.y * 0.5f, _rhandinitpos.z + offset.z * 0.6f), dst, }; t = _rhand.transform.DOLocalPath(path, _diushaizishendelta); } else { Vector3 dst = new Vector3(1.858f, -1.914f, 1.799f); Vector3 offset = dst - _rhandinitpos; Vector3[] path = new Vector3[] { _rhandinitpos, _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.1f, _rhandinitpos.y, _rhandinitpos.z + offset.z * 0.1f), _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.2f, _rhandinitpos.y, _rhandinitpos.z + offset.z * 0.2f), _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.4f, _rhandinitpos.y, _rhandinitpos.z + offset.z * 0.4f), _rhandinitpos + new Vector3(_rhandinitpos.x + offset.x * 0.6f, _rhandinitpos.y + offset.y * 0.5f, _rhandinitpos.z + offset.z * 0.6f), dst, }; t = _rhand.transform.DOLocalPath(path, _diushaizishendelta); } Sequence mySequence = DOTween.Sequence(); mySequence.Append(t) .AppendCallback(() => { // 2.0 丢色子 Bacon.GL.Game.Hand hand = _rhand.GetComponent <Bacon.GL.Game.Hand>(); hand.Rigster(Bacon.GL.Game.Hand.EVENT.DIUSHAIZI_COMPLETED, () => { // 3.1 UnityEngine.Debug.Log("top diu saizi "); ((GameController)_controller).RenderThrowDice(_d1, _d2); // 3.2, 收手 Tween t32; if (_sex == 1) { Vector3 src = new Vector3(1.858f, -1.914f, 1.799f); Vector3 offset = _rhandinitpos - src; Vector3[] path = { src, _rhandinitpos + new Vector3(src.x + offset.x * 0.6f,src.y + offset.y + 0.5f, src.z + offset.z * 0.6f), _rhandinitpos + new Vector3(src.x + offset.x * 0.4f,_rhandinitpos.y, src.z + offset.z * 0.3f), _rhandinitpos + new Vector3(src.x + offset.x * 0.2f,_rhandinitpos.y, src.z + offset.z * 0.2f), _rhandinitpos + new Vector3(src.x + offset.x * 0.1f,_rhandinitpos.y, src.z + offset.z * 0.1f), _rhandinitpos, }; t32 = _rhand.transform.DOLocalPath(path, _diushaizishendelta); } else { Vector3 src = new Vector3(1.858f, -1.914f, 1.799f); Vector3 offset = _rhandinitpos - src; Vector3[] path = { src, _rhandinitpos + new Vector3(src.x + offset.x * 0.6f,src.y + offset.y + 0.5f, src.z + offset.z * 0.6f), _rhandinitpos + new Vector3(src.x + offset.x * 0.4f,_rhandinitpos.y, src.z + offset.z * 0.3f), _rhandinitpos + new Vector3(src.x + offset.x * 0.2f,_rhandinitpos.y, src.z + offset.z * 0.2f), _rhandinitpos + new Vector3(src.x + offset.x * 0.1f,_rhandinitpos.y, src.z + offset.z * 0.1f), _rhandinitpos, }; t32 = _rhand.transform.DOLocalPath(path, _diushaizishendelta); } Sequence mySequence32 = DOTween.Sequence(); mySequence32.Append(t32). AppendCallback(() => { // 4.0 归原 animator.SetBool("Idle", true); }); }); animator.SetBool("Diushaizi", true); }); }