new structure of directories

This commit is contained in:
BlackMATov
2021-03-20 21:33:12 +07:00
parent 944b64db36
commit 72ea3571b2
742 changed files with 15 additions and 898 deletions

View File

@@ -1,42 +0,0 @@
using UnityEngine;
using System.Collections;
using FTRuntime;
using FTRuntime.Yields;
namespace FlashTools.Examples {
[RequireComponent(typeof(SwfClipController))]
public class PurpleFlowerLogic : MonoBehaviour {
static string[] _idleSequences = {"talk", "idle0", "idle1", "idle2"};
static string _fadeInSequence = "fadeIn";
static string _fadeOutSequence = "fadeOut";
void Start() {
var ctrl = GetComponent<SwfClipController>();
StartCoroutine(StartCoro(ctrl));
}
IEnumerator StartCoro(SwfClipController ctrl) {
while ( true ) {
yield return ctrl.PlayAndWaitStopOrRewind(_fadeInSequence);
for ( var i = 0; i < 3; ++i ) {
var idle_seq = GetRandomIdleSequence(ctrl);
yield return ctrl.PlayAndWaitStopOrRewind(idle_seq);
}
yield return ctrl.PlayAndWaitStopOrRewind(_fadeOutSequence);
yield return new WaitForSeconds(2.0f);
}
}
string GetRandomIdleSequence(SwfClipController ctrl) {
var cur_seq = ctrl.clip.sequence;
do {
var seq_index = Random.Range(0, _idleSequences.Length);
var new_sequence = _idleSequences[seq_index];
if ( new_sequence != cur_seq ) {
return new_sequence;
}
} while ( true );
}
}
}