コード例 #1
0
ファイル: FageBundleLoaderLoad.cs プロジェクト: buzzler/titan
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute (stateMachine);
        FageBundleLoader loader = stateMachine as FageBundleLoader;

        if (request != null) {
            if (request.isDone) {
                string name = queueAsset.Dequeue() as string;
                loader.GetLoadedAssets().Add(name, request.asset);
                request = null;
            }
        } else {
            if ((queueAsset == null) || (queueAsset.Count == 0)) {
                if (queueBundle.Count > 0) {
                    AssetBundle ab = queueBundle.Dequeue() as AssetBundle;
                    loader.GetLoadedBundles().Add(ab.name);
                }

                if ((queueBundle == null) || (queueBundle.Count == 0)) {
                    loader.ReserveState("FageBundleLoaderIdle");
                    loader.SetUpdateTime();
                    loader.DispatchEvent(new FageEvent(FageEvent.COMPLETE));
                } else {
                    AssetBundle ab = queueBundle.Peek() as AssetBundle;
                    queueAsset = new Queue(ab.GetAllAssetNames());
                }
            } else {
                AssetBundle ab = queueBundle.Peek() as AssetBundle;
                string name = queueAsset.Peek() as string;
                request = ab.LoadAssetAsync(name);
            }
        }
    }
コード例 #2
0
ファイル: FageUIManagerTransIn.cs プロジェクト: buzzler/titan
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch (stateMachine, beforeId);
     FageUIManager manager = stateMachine as FageUIManager;
     Queue queue = manager.GetRequests ();
     if (queue.Count > 0) {
         FageUIRequest request = queue.Peek () as FageUIRequest;
         switch (request.command) {
         case FageUIRequest.POP:
             ExcutePop(manager, request);
             break;
         case FageUIRequest.CHANGE:
         case FageUIRequest.PUSH:
             ExcutePush (manager, request);
             break;
         case FageUIRequest.POPUP:
         case FageUIRequest.POPDOWN:
             ExcutePopdown (manager, request);
             break;
         default:
             throw new UnityException ("unkown command");
         }
     } else {
         throw new UnityException ("request lost");
     }
 }
コード例 #3
0
ファイル: FageUIManagerSwitch.cs プロジェクト: buzzler/titan
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch (stateMachine, beforeId);
        FageBundleLoader.Instance.AddEventListener(FageEvent.COMPLETE, OnLoadBundleComplete);

        FageUIManager manager = stateMachine as FageUIManager;
        Queue queue = manager.GetRequests ();
        if (queue.Count > 0) {
            FageUIRequest request = queue.Peek () as FageUIRequest;
            switch (request.command) {
            case FageUIRequest.CHANGE:
                ExcuteChange(manager, request);
                break;
            case FageUIRequest.PUSH:
                ExcutePush (manager, request);
                break;
            case FageUIRequest.POP:
                ExcutePop(manager, request);
                break;
            case FageUIRequest.POPUP:
                ExcutePopup(manager, request);
                break;
            case FageUIRequest.POPDOWN:
                ExcutePopdown (manager, request);
                break;
            default:
                throw new UnityException ("unkown command");
            }
        } else {
            throw new UnityException ("request lost");
        }
    }
コード例 #4
0
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch (stateMachine, beforeId);
     FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;
     fsm.SetAudioStatus(FageAudioStatus.PLAYING);
     _timeSamples = fsm.audioSource.timeSamples;
 }
コード例 #5
0
	public override void Excute (FageStateMachine stateMachine) {
		base.Excute (stateMachine);
		FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;
		if (fsm.audioSource.isPlaying) {
			fsm.ReserveState("FageAudioSourcePlaying");
		}
	}
コード例 #6
0
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch(stateMachine, afterId);
     _hash = null;
     FageWebLoader.Instance.RemoveEventListener(FageEvent.COMPLETE, OnResponse);
     FageWebLoader.Instance.RemoveEventListener(FageWebEvent.PROGRESS, OnProgress);
 }
コード例 #7
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;

        fsm.SetAudioStatus(FageAudioStatus.PAUSED);
    }
コード例 #8
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        Queue         queue   = manager.GetRequests();

        if (queue.Count > 0)
        {
            FageUIRequest request = queue.Peek() as FageUIRequest;
            switch (request.command)
            {
            case FageUIRequest.POP:
                ExcutePop(manager, request);
                break;

            case FageUIRequest.CHANGE:
            case FageUIRequest.PUSH:
                ExcutePush(manager, request);
                break;

            case FageUIRequest.POPUP:
            case FageUIRequest.POPDOWN:
                ExcutePopdown(manager, request);
                break;

            default:
                throw new UnityException("unkown command");
            }
        }
        else
        {
            throw new UnityException("request lost");
        }
    }
コード例 #9
0
ファイル: FageUIManagerIdle.cs プロジェクト: buzzler/titan
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
     FageUIManager manager = stateMachine as FageUIManager;
     Queue queue = manager.GetRequests ();
     if (queue.Count > 0) {
         FageUIRequest request = queue.Peek() as FageUIRequest;
         switch(request.command) {
         case FageUIRequest.CHANGE:
         case FageUIRequest.POP:
         case FageUIRequest.PUSH:
             ExcutePush(manager, request);
             break;
         case FageUIRequest.FLUSH:
             ExcuteFlush(manager, request);
             break;
         case FageUIRequest.POPUP:
             ExcutePopup(manager, request);
             break;
         case FageUIRequest.POPDOWN:
             ExcutePopdown(manager, request);
             break;
         case FageUIRequest.LEVEL:
             ExcuteLevel(manager, request);
             break;
         default:
             throw new UnityException("unknown commnad");
         }
     }
 }
コード例 #10
0
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch (stateMachine, afterId);
     _hash = null;
     FageWebLoader.Instance.RemoveEventListener (FageEvent.COMPLETE, OnResponse);
     FageWebLoader.Instance.RemoveEventListener (FageWebEvent.PROGRESS, OnProgress);
 }
コード例 #11
0
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch (stateMachine, afterId);
     _requestId = -1;
     FageConnectionManager.Instance.RemoveEventListener(FageEvent.SENSOR_ONLINE, OnOnline);
     FageConnectionManager.Instance.RemoveEventListener(FageEvent.SENSOR_OFFLINE, OnOffline);
     FageWebLoader.Instance.RemoveEventListener(FageEvent.COMPLETE, OnResponse);
 }
コード例 #12
0
ファイル: FageAudioSourceReady.cs プロジェクト: buzzler/titan
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
     FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;
     if (fsm.audioSource.isPlaying) {
         fsm.ReserveState("FageAudioSourcePlaying");
     }
 }
コード例 #13
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;

        fsm.SetAudioStatus(FageAudioStatus.PLAYING);
        _timeSamples = fsm.audioSource.timeSamples;
    }
コード例 #14
0
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch(stateMachine, afterId);
     _requestId = -1;
     FageConnectionManager.Instance.RemoveEventListener(FageEvent.SENSOR_ONLINE, OnOnline);
     FageConnectionManager.Instance.RemoveEventListener(FageEvent.SENSOR_OFFLINE, OnOffline);
     FageWebLoader.Instance.RemoveEventListener(FageEvent.COMPLETE, OnResponse);
 }
コード例 #15
0
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch(stateMachine, beforeId);
     FageConnectionManager.Instance.AddEventListener(FageEvent.SENSOR_ONLINE, OnOnline);
     FageConnectionManager.Instance.AddEventListener(FageEvent.SENSOR_OFFLINE, OnOffline);
     FageConnectionManager.Instance.AddEventListener(FageEvent.SENSOR_PING, OnPing);
     FageWebLoader.Instance.AddEventListener(FageEvent.COMPLETE, OnResponse);
 }
コード例 #16
0
ファイル: FageUIManagerTransIn.cs プロジェクト: buzzler/titan
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
     FageUIManager manager = stateMachine as FageUIManager;
     if (current.state == FageUICommonMem.INTANTIATED) {
         manager.GetRequests ().Dequeue ();
         manager.ReserveState ("FageUIManagerIdle");
     }
 }
コード例 #17
0
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
     if (current != null) {
         if (current.state == FageUICommonMem.DESTROIED) {
             stateMachine.ReserveState("FageUIManagerSwitch");
         }
     }
 }
コード例 #18
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager   = stateMachine as FageUIManager;
        FageUIRequest request   = manager.GetRequests().Peek() as FageUIRequest;
        string        levelName = request.levelName;

        _async = FageBundleLoader.Instance.LoadLevel(levelName);
    }
コード例 #19
0
ファイル: FageUIManagerLoad.cs プロジェクト: buzzler/titan
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch (stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        FageUIRequest request = manager.GetRequests ().Peek () as FageUIRequest;
        string levelName = request.levelName;

        _async = FageBundleLoader.Instance.LoadLevel(levelName);
    }
コード例 #20
0
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch(stateMachine, afterId);
     _effector   = null;
     _screen     = null;
     _blur       = null;
     _presetFrom = null;
     _presetTo   = null;
 }
コード例 #21
0
    public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
    {
        base.BeforeSwitch(stateMachine, afterId);
        GalleryScreen gs = stateMachine as GalleryScreen;

        gs.HideTexts();
        gs.HideStars();
        gs.HideButtons();
    }
コード例 #22
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        GalleryScreen gs = stateMachine as GalleryScreen;

        if (gs.IsDragging())
        {
            gs.ReserveState("GalleryDragging");
        }
    }
コード例 #23
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        Debug.Log("GalleryLocked");
        GalleryScreen gs = stateMachine as GalleryScreen;

        gs.ShowTexts();
        gs.HideStars();
        gs.ShowButtons();
    }
コード例 #24
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch (stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        _curtain = manager.canvas.GetComponentInChildren<IFageUICurtainComponent>();
        if (_curtain == null)
            throw new UnityException("no interface found : IFageUICurtainComponent");

        _curtain.StartOpen(OnOpenComplete);
    }
コード例 #25
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        CameraEffector effector = stateMachine as CameraEffector;

        if (effector.GetRequestCount() > 0)
        {
            effector.ReserveState("CameraEffectorTween");
        }
    }
コード例 #26
0
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute(stateMachine);
     if (current != null)
     {
         if (current.state == FageUICommonMem.DESTROIED)
         {
             stateMachine.ReserveState("FageUIManagerSwitch");
         }
     }
 }
コード例 #27
0
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute(stateMachine);
     switch (Application.internetReachability)
     {
     case NetworkReachability.ReachableViaCarrierDataNetwork:
     case NetworkReachability.ReachableViaLocalAreaNetwork:
         stateMachine.ReserveState("FageConnectionPing");
         break;
     }
 }
コード例 #28
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;

        if (current.state == FageUICommonMem.INTANTIATED)
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
        }
    }
コード例 #29
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        Debug.Log("GalleryScrolling");
        GalleryScreen gs = stateMachine as GalleryScreen;

        gs.HideTexts();
        gs.HideStars();
        gs.HideButtons();

        LeanTween.move(gs.content.transform as RectTransform, new Vector3(0f, -(gs.availables - 1) * gs.gap, 0f), 2f).setDelay(1.3f).setEase(LeanTweenType.easeInOutCubic).setOnComplete(OnTweenComplete).setOnCompleteParam(gs);
    }
コード例 #30
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;

        _curtain = manager.canvas.GetComponentInChildren <IFageUICurtainComponent>();
        if (_curtain == null)
        {
            throw new UnityException("no interface found : IFageUICurtainComponent");
        }

        _curtain.StartOpen(OnOpenComplete);
    }
コード例 #31
0
ファイル: FageUIManagerLoad.cs プロジェクト: buzzler/titan
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute (stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;

        if (_async != null) {
            if (_async.isDone)
                manager.ReserveState ("FageUIManagerCurtOpen");
        } else {
            manager.GetRequests().Dequeue();
            manager.ReserveState ("FageUIManagerIdle");
        }
    }
コード例 #32
0
ファイル: FageBundleLoaderIdle.cs プロジェクト: buzzler/titan
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
     FageBundleLoader loader = stateMachine as FageBundleLoader;
     if ((loader.expireTime < (Time.unscaledTime - loader.GetUpdateTime())) || loader.flagUpdate) {
         loader.flagUpdate = false;
         loader.ReserveState("FageBundleLoaderCheck");
     } else if (loader.flagLoad) {
         loader.ReserveState("FageBundleLoaderLoad");
     } else if (loader.flagDownload) {
         loader.flagDownload = false;
         loader.ReserveState("FageBundleLoaderDownload");
     }
 }
コード例 #33
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch (stateMachine, beforeId);
        FageConnectionManager.Instance.AddEventListener(FageEvent.SENSOR_ONLINE, OnOnline);
        FageConnectionManager.Instance.AddEventListener(FageEvent.SENSOR_OFFLINE, OnOffline);
        FageConnectionManager.Instance.AddEventListener(FageEvent.SENSOR_PING, OnPing);
        FageWebLoader.Instance.AddEventListener(FageEvent.COMPLETE, OnResponse);

        //		if (FageConnectionManager.Instance.IsOnline()) {
        //			OnOnline(null);
        //		} else {
        //			OnOffline(null);
        //		}
    }
コード例 #34
0
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
     FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;
     if (!fsm.audioSource.isPlaying) {
         if (fsm.audioSource.timeSamples > 0) {
             fsm.ReserveState("FageAudioSourcePaused");
         } else {
             fsm.ReserveState("FageAudioSourceReady");
         }
     } else if (_timeSamples > fsm.audioSource.timeSamples) {
         fsm.NotifyLoop();
     }
     _timeSamples = fsm.audioSource.timeSamples;
 }
コード例 #35
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch (stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        FageUIRequest request = manager.GetRequests ().Peek () as FageUIRequest;

        if ((request.uiCurtain == null) || (request.levelName == null))
            throw new UnityException ("parameter (FageUICurtain, levelName) is required");

        GameObject go = GameObject.Instantiate (FageBundleLoader.Instance.Load (request.uiCurtain) as GameObject);
        go.transform.SetParent (manager.canvas, false);
        IFageUICurtainComponent curtain = go.GetComponent<IFageUICurtainComponent> ();
        if (curtain == null)
            throw new UnityException ("no interface found : IFageUICurtainComponent");

        curtain.StartClose (OnCloseComplete);
    }
コード例 #36
0
ファイル: FageConnectionPing.cs プロジェクト: buzzler/titan
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute (stateMachine);
        if (Application.internetReachability == NetworkReachability.NotReachable) {
            if (_online) {
                stateMachine.DispatchEvent (new FageEvent (FageEvent.SENSOR_OFFLINE));
            }
            stateMachine.ReserveState ("FageConnectionStart");
            return;
        }

        if (_ping != null) {
            bool last = _online;
            if (_ping.isDone) {
                _ping_time = _ping.time;
                InitPing();
                _last_time = Time.realtimeSinceStartup;
                _online = true;
            } else if ((Time.realtimeSinceStartup - _start_time) > _TIMEOUT) {
                _ping_time = (int)_TIMEOUT * 1000;
                InitPing();
                _last_time = Time.realtimeSinceStartup;
                _online = false;
            } else {
                return;
            }

            if (last != _online) {
                if (_online) {
                    stateMachine.DispatchEvent (new FageEvent (FageEvent.SENSOR_ONLINE));
                } else {
                    stateMachine.DispatchEvent (new FageEvent (FageEvent.SENSOR_OFFLINE));
                }
            } else {
                stateMachine.DispatchEvent (new FageEvent (FageEvent.SENSOR_PING, _ping_time));
            }
        }

        if (_ping == null) {
            if ((Time.realtimeSinceStartup - _last_time) >= _ITERATE) {
                _ping = new Ping (_ADDRESS);
                _start_time = Time.realtimeSinceStartup;
            }
        }
    }
コード例 #37
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;

        if (_async != null)
        {
            if (_async.isDone)
            {
                manager.ReserveState("FageUIManagerCurtOpen");
            }
        }
        else
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
        }
    }
コード例 #38
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageBundleLoader loader = stateMachine as FageBundleLoader;

        if (request != null)
        {
            if (request.isDone)
            {
                string name = queueAsset.Dequeue() as string;
                loader.GetLoadedAssets().Add(name, request.asset);
                request = null;
            }
        }
        else
        {
            if ((queueAsset == null) || (queueAsset.Count == 0))
            {
                if (queueBundle.Count > 0)
                {
                    AssetBundle ab = queueBundle.Dequeue() as AssetBundle;
                    loader.GetLoadedBundles().Add(ab.name);
                }

                if ((queueBundle == null) || (queueBundle.Count == 0))
                {
                    loader.ReserveState("FageBundleLoaderIdle");
                    loader.SetUpdateTime();
                    loader.DispatchEvent(new FageEvent(FageEvent.COMPLETE));
                }
                else
                {
                    AssetBundle ab = queueBundle.Peek() as AssetBundle;
                    queueAsset = new Queue(ab.GetAllAssetNames());
                }
            }
            else
            {
                AssetBundle ab   = queueBundle.Peek() as AssetBundle;
                string      name = queueAsset.Peek() as string;
                request = ab.LoadAssetAsync(name);
            }
        }
    }
コード例 #39
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        _effector = stateMachine as CameraEffector;
        _screen   = _effector.screen;
        _blur     = _effector.blur;

        EffectRequest request = _effector.GetRequest();

        if (request == null)
        {
            _effector.ReserveState("CameraEffectorIdle");
            return;
        }

        _presetFrom = _effector.DumpEffect();
        _presetTo   = _effector.GetPreset(request.preset);
        if (_presetTo == null)
        {
            _effector.ReserveState("CameraEffectorIdle");
            return;
        }

        if (request.second > 0)
        {
            if ((_presetFrom.blurSize != _presetTo.blurSize) &&
                (_presetFrom.blurEnable != _presetTo.blurEnable))
            {
                _blur.enabled = true;
            }
            if ((_presetFrom.screenSaturation != _presetTo.screenSaturation) ||
                (_presetFrom.chromaticAberrationMagnetude != _presetTo.chromaticAberrationMagnetude) ||
                (_presetFrom.staticMagnetude != _presetTo.staticMagnetude) &&
                (_presetFrom.screenEnable != _presetTo.screenEnable))
            {
                _screen.enabled = true;
            }
            LeanTween.value(_effector.gameObject, 0f, 1f, request.second).setOnUpdate(OnTweenUpdate).setOnComplete(OnTweenComplete);
        }
        else
        {
            OnTweenComplete();
        }
    }
コード例 #40
0
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch (stateMachine, beforeId);
     FageWebLoader loader = FageWebLoader.Instance;
     loader.AddEventListener(FageEvent.COMPLETE, OnResponse);
     loader.AddEventListener (FageWebEvent.PROGRESS, OnProgress);
     _hash = new Hashtable();
     foreach (FageBundle bundle in FageBundleRoot.Instance.bundles) {
     #if UNITY_EDITOR
         _hash.Add(loader.Request(bundle.ios, bundle.version), bundle);
     #elif UNITY_IOS
         _hash.Add(loader.Request(bundle.ios, bundle.version), bundle);
     #elif UNITY_ANDROID
         _hash.Add(loader.Request(bundle.android, bundle.version), bundle);
     #endif
     }
     _total = (float)_hash.Count;
     stateMachine.DispatchEvent (new FageBundleEvent(FageBundleEvent.DOWNLOADING));
 }
コード例 #41
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageBundleLoader.Instance.AddEventListener(FageEvent.COMPLETE, OnLoadBundleComplete);

        FageUIManager manager = stateMachine as FageUIManager;
        Queue         queue   = manager.GetRequests();

        if (queue.Count > 0)
        {
            FageUIRequest request = queue.Peek() as FageUIRequest;
            switch (request.command)
            {
            case FageUIRequest.CHANGE:
                ExcuteChange(manager, request);
                break;

            case FageUIRequest.PUSH:
                ExcutePush(manager, request);
                break;

            case FageUIRequest.POP:
                ExcutePop(manager, request);
                break;

            case FageUIRequest.POPUP:
                ExcutePopup(manager, request);
                break;

            case FageUIRequest.POPDOWN:
                ExcutePopdown(manager, request);
                break;

            default:
                throw new UnityException("unkown command");
            }
        }
        else
        {
            throw new UnityException("request lost");
        }
    }
コード例 #42
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageBundleLoader loader = stateMachine as FageBundleLoader;

        if ((loader.expireTime < (Time.unscaledTime - loader.GetUpdateTime())) || loader.flagUpdate)
        {
            loader.flagUpdate = false;
            loader.ReserveState("FageBundleLoaderCheck");
        }
        else if (loader.flagLoad)
        {
            loader.ReserveState("FageBundleLoaderLoad");
        }
        else if (loader.flagDownload)
        {
            loader.flagDownload = false;
            loader.ReserveState("FageBundleLoaderDownload");
        }
    }
コード例 #43
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageWebLoader loader = FageWebLoader.Instance;

        loader.AddEventListener(FageEvent.COMPLETE, OnResponse);
        loader.AddEventListener(FageWebEvent.PROGRESS, OnProgress);
        _hash = new Hashtable();
        foreach (FageBundle bundle in FageBundleRoot.Instance.bundles)
        {
#if UNITY_EDITOR
            _hash.Add(loader.Request(bundle.ios, bundle.version), bundle);
#elif UNITY_IOS
            _hash.Add(loader.Request(bundle.ios, bundle.version), bundle);
#elif UNITY_ANDROID
            _hash.Add(loader.Request(bundle.android, bundle.version), bundle);
#endif
        }
        _total = (float)_hash.Count;
        stateMachine.DispatchEvent(new FageBundleEvent(FageBundleEvent.DOWNLOADING));
    }
コード例 #44
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;

        if (!fsm.audioSource.isPlaying)
        {
            if (fsm.audioSource.timeSamples > 0)
            {
                fsm.ReserveState("FageAudioSourcePaused");
            }
            else
            {
                fsm.ReserveState("FageAudioSourceReady");
            }
        }
        else if (_timeSamples > fsm.audioSource.timeSamples)
        {
            fsm.NotifyLoop();
        }
        _timeSamples = fsm.audioSource.timeSamples;
    }
コード例 #45
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;
        Queue         queue   = manager.GetRequests();

        if (queue.Count > 0)
        {
            FageUIRequest request = queue.Peek() as FageUIRequest;
            switch (request.command)
            {
            case FageUIRequest.CHANGE:
            case FageUIRequest.POP:
            case FageUIRequest.PUSH:
                ExcutePush(manager, request);
                break;

            case FageUIRequest.FLUSH:
                ExcuteFlush(manager, request);
                break;

            case FageUIRequest.POPUP:
                ExcutePopup(manager, request);
                break;

            case FageUIRequest.POPDOWN:
                ExcutePopdown(manager, request);
                break;

            case FageUIRequest.LEVEL:
                ExcuteLevel(manager, request);
                break;

            default:
                throw new UnityException("unknown commnad");
            }
        }
    }
コード例 #46
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        FageUIRequest request = manager.GetRequests().Peek() as FageUIRequest;

        if ((request.uiCurtain == null) || (request.levelName == null))
        {
            throw new UnityException("parameter (FageUICurtain, levelName) is required");
        }

        GameObject go = GameObject.Instantiate(FageBundleLoader.Instance.Load(request.uiCurtain) as GameObject);

        go.transform.SetParent(manager.canvas, false);
        IFageUICurtainComponent curtain = go.GetComponent <IFageUICurtainComponent> ();

        if (curtain == null)
        {
            throw new UnityException("no interface found : IFageUICurtainComponent");
        }

        curtain.StartClose(OnCloseComplete);
    }
コード例 #47
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        GalleryScreen gs = stateMachine as GalleryScreen;

        if (!gs.IsDragging())
        {
            RectTransform rt = gs.GetNearestItem();

            /**
             * something
             */
            switch (Random.Range(1, 3))
            {
            case 1:
                gs.ReserveState("GalleryUnlocked");
                break;

            case 2:
                gs.ReserveState("GalleryLocked");
                break;
            }
        }
    }
コード例 #48
0
ファイル: FageAudioSourceReady.cs プロジェクト: buzzler/titan
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch (stateMachine, afterId);
 }
コード例 #49
0
ファイル: FageState.cs プロジェクト: buzzler/titan
 public virtual void BeforeSwitch(FageStateMachine stateMachine, string afterId = null)
 {
 }
コード例 #50
0
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch(stateMachine, afterId);
 }
コード例 #51
0
ファイル: FageState.cs プロジェクト: buzzler/titan
 public virtual void Excute(FageStateMachine stateMachine)
 {
 }
コード例 #52
0
ファイル: FageUIManagerSwitch.cs プロジェクト: buzzler/titan
 public override void BeforeSwitch(FageStateMachine stateMachine, string afterId)
 {
     base.BeforeSwitch (stateMachine, afterId);
     FageBundleLoader.Instance.RemoveEventListener(FageEvent.COMPLETE, OnLoadBundleComplete);
 }
コード例 #53
0
ファイル: FageBundleLoaderLoad.cs プロジェクト: buzzler/titan
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch (stateMachine, beforeId);
        List<string> resources = new List<string>();
        List<string> loadBundles = new List<string>();
        List<string> unloadBundles = new List<string>();

        FageBundleLoader loader = stateMachine as FageBundleLoader;
        Dictionary<string, AssetBundle> downloadedBundles = loader.GetDownloadedBundles();
        Dictionary<string, object> loadedAsset = loader.GetLoadedAssets();
        List<string> loadedBundles = loader.GetLoadedBundles();

        FageUIManager manager = FageUIManager.Instance;
        Stack stack = manager.GetStack();
        Queue queue = manager.GetQueue();
        if (stack.Count > 0) {
            FageUIMem mem = stack.Peek() as FageUIMem;
            foreach (string s in mem.uiSet.GetBundles()) {
                if (!resources.Contains(s))
                    resources.Add(s);
            }
        }
        if (queue.Count > 0) {
            FageUIPopupMem mem = queue.Peek() as FageUIPopupMem;
            foreach (string s in mem.uiSet.GetBundles()) {
                if (!resources.Contains(s))
                    resources.Add(s);
            }
        }
        foreach (FageBundle bundle in FageBundleRoot.Instance.bundles) {
            if ((!bundle.isDynamic) && (!loadBundles.Contains(bundle.id))) {
                loadBundles.Add(bundle.id);
            } else if ((resources.Contains(bundle.id)) && (!loadBundles.Contains(bundle.id))) {
                loadBundles.Add(bundle.id);
            }
        }

        foreach (string id in loadedBundles) {
            if (loadBundles.Contains(id)) {
                loadBundles.Remove(id);
            } else if (!unloadBundles.Contains(id)) {
                unloadBundles.Add(id);
            }
        }

        queueBundle = new Queue();
        foreach (string s in loadBundles) {
            AssetBundle ab = downloadedBundles[s];
            ab.name = s;
            queueBundle.Enqueue(ab);
        }

        foreach (string s in unloadBundles) {
            AssetBundle ab = downloadedBundles[s];
            foreach (string abname in ab.GetAllAssetNames()) {
                loadedAsset.Remove(abname);
            }
            loadedBundles.Remove(s);
        }
        if (queueBundle.Count > 0) {
            AssetBundle ab = queueBundle.Peek () as AssetBundle;
            queueAsset = new Queue (ab.GetAllAssetNames ());
        }

        stateMachine.DispatchEvent (new FageBundleEvent(FageBundleEvent.LOADING));
    }
コード例 #54
0
ファイル: FageConnectionPing.cs プロジェクト: buzzler/titan
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch (stateMachine, beforeId);
     InitPing ();
 }
コード例 #55
0
 public override void Excute(FageStateMachine stateMachine)
 {
     base.Excute (stateMachine);
 }
コード例 #56
0
ファイル: FageState.cs プロジェクト: buzzler/titan
 public virtual void AfterSwitch(FageStateMachine stateMachine, string beforeId = null)
 {
 }
コード例 #57
0
ファイル: FageAudioSourceReady.cs プロジェクト: buzzler/titan
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch (stateMachine, beforeId);
     FageAudioSourceControl fsm = stateMachine as FageAudioSourceControl;
     fsm.SetAudioStatus(FageAudioStatus.READY);
 }
コード例 #58
0
 public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
 {
     base.AfterSwitch(stateMachine, beforeId);
     Debug.Log("GalleryDragging");
 }