Esempio n. 1
0
            private IEnumerator GetAssetBundle(string url, Hash128 hash)
            {
                DebugConditional.LogFormat("-- load bundle from {0}...", url);
                var www = UnityWebRequestAssetBundle.GetAssetBundle(url, hash);

                yield return(www.SendWebRequest());

                if (www.isNetworkError || www.isHttpError)
                {
                    throw new Exception($"Failed to load bundle {url} with error: {www.error}");
                }

                _loadRoutine = null;

                Bundle = DownloadHandlerAssetBundle.GetContent(www);

                if (_isDisposed)
                {
                    Bundle.Unload(true);
                    Bundle = null;
                }
                else
                {
                    ManageAtlases();
                    ManageSounds();
                    DebugConditional.Log("... bundle loaded successfully.");
                    _complete.SetValueAndForceNotify(true);
                }
            }
Esempio n. 2
0
        private void StartNextTask()
        {
            Assert.IsNull(_currentTaskCompleteHandler);

            if (_queue.Count <= 0)
            {
                _currentGameTask = null;
                _complete.SetValueAndForceNotify(true);
                return;
            }

            _currentGameTask = _queue.Dequeue();
            if (_currentGameTask.Complete.Value)
            {
                Debug.LogWarning("Task in queue already completed.");
                // ReSharper disable once TailRecursiveCall
                StartNextTask();
                return;
            }

            _currentTaskCompleteHandler = _currentGameTask.Complete.Subscribe(value =>
            {
                if (!value)
                {
                    return;
                }
                // ReSharper disable once AccessToModifiedClosure
                _currentTaskCompleteHandler?.Dispose();
                _currentTaskCompleteHandler = null;
                StartNextTask();
            });
            _currentGameTask.Start();
        }
Esempio n. 3
0
    private bool JudgeResult()
    {
        if (!this.m_playerCreature)
        {
            this.m_isSetting = false;
            m_isFinish.SetValueAndForceNotify(true);
            return(true);
        }
        else if (!this.m_enemyCreature)
        {
            this.m_isSetting = false;
            m_isFinish.SetValueAndForceNotify(true);
            return(true);
        }

        return(false);
    }
Esempio n. 4
0
 public void ReleasedCallback()
 {
     this.transform.parent = null;
     m_vrgGrabbable        = null;
     Destroy(GetComponent <VrgGrabbable>());
     m_playerCore.RecastRc.SetValueAndForceNotify(m_rcType);
     m_grabbed.SetValueAndForceNotify(false);
     m_released.SetValueAndForceNotify(true);
 }
        // ITask

        public void Start()
        {
            if (_completeHandlers.Any() || Complete.Value || _isDisposed)
            {
                return;
            }

            if (_tasks.Count > 0)
            {
                _tasks.ForEach(SubscribeComplete);
                _tasks.ForEach(task => task.Start());
                _tasks.Clear();
            }
            else
            {
                _complete.SetValueAndForceNotify(true);
            }
        }
Esempio n. 6
0
        // \IDisposable

        private void DoStart()
        {
            if (_isActive.Value)
            {
                return;
            }

            _players.ForEach(SpawnPlayer);
            _isActive.SetValueAndForceNotify(true);
        }
Esempio n. 7
0
    private IEnumerator SceneChengeStop()
    {
        yield return(new WaitForSeconds(2.0f));

        m_fadePanel.IsFadeOut = true;
        yield return(new WaitForSeconds(1.0f));

        if (SceneManager.GetActiveScene().name == "TutorialCaptureScene")
        {
            m_isFinish.SetValueAndForceNotify(true);
        }
        else if (SceneManager.GetActiveScene().name == "TutorialBattleScene")
        {
            m_isAllFinish.SetValueAndForceNotify(true);
        }

        yield return(null);
    }
        // ITask

        public void Start()
        {
            if (_gameTask != null)
            {
                return;
            }
            _gameTask        = _closure.Invoke();
            _completeHandler = _gameTask.Complete.Subscribe(value =>
            {
                _complete.SetValueAndForceNotify(value);
                if (!value)
                {
                    return;
                }
                _completeHandler.Dispose();
                _completeHandler = null;
            });
            _gameTask.Start();
        }
Esempio n. 9
0
        private IEnumerator LoadManifest(string path)
        {
            DebugConditional.LogFormat("-- load bundles manifest from {0}...", path);
            using (var www = UnityWebRequest.Get(path))
            {
                yield return(www.SendWebRequest());

                if (www.isNetworkError || www.isHttpError)
                {
                    Debug.LogErrorFormat("Failed to load manifest from {0} with error: {1}", path, www.error);
                }
                else
                {
                    var manifest = JsonUtility.FromJson <BundleManifest>(www.downloadHandler.text);
                    _bundleDataMap = manifest.Bundles.ToDictionary(description => description.Name);
                    DebugConditional.Log("... manifest loaded successfully.");
                    _ready.SetValueAndForceNotify(true);
                }
            }
        }
Esempio n. 10
0
    /// <summary>
    /// 更新前処理
    /// </summary>
    void Start()
    {
        // コアの参照
        m_cores = GetComponentsInChildren <GimmickCore>();

        SwitchActive();

        // 衝突情報の更新と通知
        this.UpdateAsObservable()
        .Select(_ => m_isEnter)
        .Subscribe(x => IsEnterRP.SetValueAndForceNotify(x));

        // アクティブの切り替え
        IsEnterRP
        .DistinctUntilChanged()
        .Subscribe(x =>
        {
            SwitchActive();
        });
    }
Esempio n. 11
0
 public void GrabbedCallback()
 {
     m_grabbed.SetValueAndForceNotify(true);
 }
 public static void ReloadDrawers()
 {
     LoadDrawers();
     LoadFieldInfoDrawers();
     ready.SetValueAndForceNotify(true);
 }
Esempio n. 13
0
 private void SetCanShoot(long x)
 {
     m_CanShoot.SetValueAndForceNotify(true);
 }