/// <summary> /// RoleTweenProviderを使って、特定のRoleに任意のReelSequenceを生成します。 /// </summary> /// <param name="sequenceSelector"></param> /// <param name="target"></param> /// <returns></returns> public IReelSequence CreateFromProvider(Func <RoleTweenProvider, Sequence> sequenceSelector, RoleValue target) { var sq = ReelSequence.Empty(); sq[target] = sequenceSelector(tweenProvider[target]); return(sq); }
public override IReelSequence Create(AntagonistSequenceProperty property) { //リール全体が行ったり来たりするシーケンスを生成 var antagonistSq = ReelSequence.Empty() .Append(sqProvider.CreateRollSequence(roleIntervalAngle * .5f, .3f)) //.5 .Append(sqProvider.CreateRollSequence(roleIntervalAngle * -.5f, .3f)) // 0 .Append(sqProvider.CreateRollSequence(roleIntervalAngle * .7f, .3f)) //.7 .Append(sqProvider.CreateRollSequence(roleIntervalAngle * -.5f, .3f)) //.2 .Append(sqProvider.CreateRollSequence(roleIntervalAngle * .6f, .3f)) //.8 .Append(sqProvider.CreateRollSequence(roleIntervalAngle * -.4f, .3f)) //.4 .Append(sqProvider.CreateRollSequence(roleIntervalAngle * .5f, .3f)) //.9 .AppendInterval(1f); //最後に、当たりかハズレかによって、リールを進めるか戻すかのシーケンスを追加する if (property.IsOffenserWin) { antagonistSq.Append(sqProvider.CreateRollSequence(roleIntervalAngle * .1f, .1f)); } else { antagonistSq.Append(sqProvider.CreateRollSequence(roleIntervalAngle * -.9f, .4f)); } return(antagonistSq); }
/// <summary> /// 任意のRoleに任意のTweenを当てはめたReelaSequenceを生成します /// </summary> /// <param name="sequenceSelector"></param> /// <param name="targets">適用するRoleValue</param> /// <returns></returns> public IReelSequence Create(Func <Transform, Sequence> sequenceSelector, params RoleValue[] targets) { var sqTable = targets.ToDictionary(role => role, role => tweenProvider[role].Create(sequenceSelector)); return(ReelSequence.Empty() .DictionaryCombine(sqTable, (_, sq) => sq, () => DOTween.Sequence(), () => DOTween.Sequence()) .ToReelSequence()); }
public override IReelSequence Create(AntagonistSequenceProperty property) => ReelSequence.Empty() //中央までリールを回転させて .Append(sqProvider.CreateRollSequence(roleIntervalAngle * .5f, 1.5f)) //振動させて .Append(sqProvider.Create(t => t.DOShakePosition(3, 0.02f).ToSequence(), property.Offenser, property.Defenser)) //当たりなら進める、ハズレなら戻す .Append(sqProvider.CreateRollSequence(property.IsOffenserWin ? roleIntervalAngle * .5f : roleIntervalAngle * -.5f, .5f));