Yields instructions

This commit is contained in:
2017-02-11 20:57:49 +07:00
parent 290fd066b5
commit 21fe31585f
9 changed files with 527 additions and 343 deletions

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 91d10069039ad437fbd214463d482c1c
folderAsset: yes
timeCreated: 1486819578
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,51 @@
using System.Collections;
namespace FTRuntime.Yields {
public class SwfWaitPlayStopped : IEnumerator {
SwfClipController _waitCtrl;
public SwfWaitPlayStopped(SwfClipController ctrl) {
Subscribe(ctrl);
}
public SwfWaitPlayStopped Reuse(SwfClipController ctrl) {
return Subscribe(ctrl);
}
//
// Private
//
SwfWaitPlayStopped Subscribe(SwfClipController ctrl) {
(this as IEnumerator).Reset();
if ( ctrl ) {
_waitCtrl = ctrl;
ctrl.OnPlayStoppedEvent += OnPlayStopped;
}
return this;
}
void OnPlayStopped(SwfClipController ctrl) {
(this as IEnumerator).Reset();
}
//
// IEnumerator
//
bool IEnumerator.MoveNext() {
return _waitCtrl != null;
}
void IEnumerator.Reset() {
if ( _waitCtrl != null ) {
_waitCtrl.OnPlayStoppedEvent -= OnPlayStopped;
_waitCtrl = null;
}
}
object IEnumerator.Current {
get { return null; }
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 92ee4f87c0bcf4943abc9e5cdaffea72
timeCreated: 1486821636
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,51 @@
using System.Collections;
namespace FTRuntime.Yields {
public class SwfWaitRewindPlaying : IEnumerator {
SwfClipController _waitCtrl;
public SwfWaitRewindPlaying(SwfClipController ctrl) {
Subscribe(ctrl);
}
public SwfWaitRewindPlaying Reuse(SwfClipController ctrl) {
return Subscribe(ctrl);
}
//
// Private
//
SwfWaitRewindPlaying Subscribe(SwfClipController ctrl) {
(this as IEnumerator).Reset();
if ( ctrl ) {
_waitCtrl = ctrl;
ctrl.OnRewindPlayingEvent += OnRewindPlaying;
}
return this;
}
void OnRewindPlaying(SwfClipController ctrl) {
(this as IEnumerator).Reset();
}
//
// IEnumerator
//
bool IEnumerator.MoveNext() {
return _waitCtrl != null;
}
void IEnumerator.Reset() {
if ( _waitCtrl != null ) {
_waitCtrl.OnRewindPlayingEvent -= OnRewindPlaying;
_waitCtrl = null;
}
}
object IEnumerator.Current {
get { return null; }
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a489e38279e094af4b5ef8859282295f
timeCreated: 1486819593
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,51 @@
using System.Collections;
namespace FTRuntime.Yields {
public class SwfWaitStopPlaying : IEnumerator {
SwfClipController _waitCtrl;
public SwfWaitStopPlaying(SwfClipController ctrl) {
Subscribe(ctrl);
}
public SwfWaitStopPlaying Reuse(SwfClipController ctrl) {
return Subscribe(ctrl);
}
//
// Private
//
SwfWaitStopPlaying Subscribe(SwfClipController ctrl) {
(this as IEnumerator).Reset();
if ( ctrl ) {
_waitCtrl = ctrl;
ctrl.OnStopPlayingEvent += OnStopPlaying;
}
return this;
}
void OnStopPlaying(SwfClipController ctrl) {
(this as IEnumerator).Reset();
}
//
// IEnumerator
//
bool IEnumerator.MoveNext() {
return _waitCtrl != null;
}
void IEnumerator.Reset() {
if ( _waitCtrl != null ) {
_waitCtrl.OnStopPlayingEvent -= OnStopPlaying;
_waitCtrl = null;
}
}
object IEnumerator.Current {
get { return null; }
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3be861087be4b442092da862ff38f151
timeCreated: 1486819592
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: