void CreateReels() { if (_reels != null) { return; } int count = _machineConfig.column; _reels = new List <Reel>(count); var prefab = _machineConfig.ReelPrefab; for (var i = 0; i < count; ++i) { Reel reel = Instantiate(prefab) as Reel; reel.Column = i; reel.OnStop += OnStopListener; reel.transform.SetParent(_tf); reel.transform.localPosition = Vector3.right * _machineConfig.ReelSpace * i; reel.Initialize(_machine); _reels.Add(reel); } }
public void SetReel(Reel reel, float ypos, bool asFirst = false) { _relativeReel = reel; _tf.SetParent(_relativeReel.SymbolContainer); Y = ypos; if (asFirst) { _tf.SetAsFirstSibling(); } }
void OnStopListener(Reel reel) { // Debug.Log("^^^^^^ reel " + reel.Column + " stopped"); // Debug.Log("!!!! try CheckScatters"); _lastStoppedReel = reel; CheckScatters(); ++_nextStopIndex; CheckNextReel(); }
void Reset() { if (_fallbackAnim != null) { _fallbackAnim.Kill(); _fallbackAnim = null; } _relativeReel = null; //stop anim // _content scale alpha ...etc reset // _sprite scale alpha ...etc reset // reset blur }
// public void Reset() // { // _index = 0; // } public bool CheckScattered(Reel reel, out AudioClip stopSound) { // Debug.Log("reel: " + reel.Column + " check ableReel: " + string.Join(",", ableReel.Select(x => x.ToString()).ToArray())); // if (Array.IndexOf(ableReel, reel.Column) == -1 || // reel.ContainsByName(symbolName) == false) // { // stopSound = null; // Debug.Log("no scatterd: " + Array.IndexOf(ableReel, reel.Column) + " : " + reel.ContainsByName(symbolName)); // return false; // } // Debug.Log(symbolName + " scattered"); // stopSound = stopSounds[_index++]; stopSound = null; return(true); }