Ejemplo n.º 1
0
        public static ICutEffect GetCutEffect(SceneTypeEnum sceneType)
        {
            ICutEffect cutEffect = null;

            if (sceneType == SceneTypeEnum.CurveStagger)
            {
                cutEffect = new CurveStaggerCutEffect();
            }
            else if (sceneType == SceneTypeEnum.FrontBackUnfold)
            {
                cutEffect = new FrontBackUnfoldCutEffect();
            }
            else if (sceneType == SceneTypeEnum.LeftRightAdjust)
            {
                cutEffect = new LeftRightAdjustCutEffect();
            }
            else if (sceneType == SceneTypeEnum.MidDisperse)
            {
                cutEffect = new MidDisperseCutEffect();
            }
            else if (sceneType == SceneTypeEnum.UpDownAdjustCutEffect)
            {
                cutEffect = new UpDownAdjustCutEffect();
            }


            return(cutEffect);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     获取场景持续时间
        /// </summary>
        /// <param name="sceneTypeEnum"></param>
        /// <returns></returns>
        public float GetSceneDurTime(SceneTypeEnum sceneTypeEnum)
        {
            string key = "";

            if (sceneTypeEnum == SceneTypeEnum.CurveStagger)
            {
                key = AppConfig.KEY_CutEffectDuring_CurveStagger;
            }
            else if (sceneTypeEnum == SceneTypeEnum.FrontBackUnfold)
            {
                key = AppConfig.KEY_CutEffectDuring_FrontBackUnfold;
            }
            else if (sceneTypeEnum == SceneTypeEnum.LeftRightAdjust)
            {
                key = AppConfig.KEY_CutEffectDuring_LeftRightAdjust;
            }
            else if (sceneTypeEnum == SceneTypeEnum.MidDisperse)
            {
                key = AppConfig.KEY_CutEffectDuring_MidDisperseAdjust;
            }
            else if (sceneTypeEnum == SceneTypeEnum.Stars)
            {
                key = AppConfig.KEY_CutEffectDuring_Stars;
            }
            else if (sceneTypeEnum == SceneTypeEnum.UpDownAdjustCutEffect)
            {
                key = AppConfig.KEY_CutEffectDuring_UpDownAdjust;
            }

            string durTime = GetConfigByKey(key).Value;
            float  d       = AppUtils.ConvertToFloat(durTime);

            return(d);
        }
Ejemplo n.º 3
0
    public void Navigate(SceneTypeEnum sceneTypeFrom, SceneTypeEnum sceneTypeTo, CustomObject customObject)
    {
        var sceneName = Strings.GetScenePath(sceneTypeTo);

        // Load Scene
        _loadOperation = SceneManager.LoadSceneAsync(sceneName);
        _loadOperation.allowSceneActivation = true;
        LogicManager.BaseManagers.Coroutiner.StartCoroutine(WaitSceneLoading(sceneTypeTo, customObject,
                                                                             () => OnChanged(EventTypeEnum.NavigationEnd, sceneTypeTo)));
    }
Ejemplo n.º 4
0
    public static string GetScenePath(SceneTypeEnum sceneTypeTo)
    {
        string sceneName;
        var    isExists = _sceneNameStorage.TryGetValue(sceneTypeTo, out sceneName);

        if (isExists == false)
        {
            throw new UnityException("It is unknown scene");
        }
        return(sceneName);
    }
 private void HandeleSceneChanged(SceneTypeEnum sceneType)
 {
     if (sceneType == this._sceneType)
     {
         _canvasObject.SetActive(true);
     }
     else
     {
         _canvasObject.SetActive(false);//dsadasd
     }
 }
Ejemplo n.º 6
0
 private void HandleSceneChanged(SceneTypeEnum sceneType)
 {
     if (sceneType == this.sceneType)
     {
         canvasObject.SetActive(true);
     }
     else
     {
         canvasObject.SetActive(false);
     }
 }
Ejemplo n.º 7
0
 public SceneConfig(SceneTypeEnum sceneTypeEnum, DataTypeEnum dataType,
                    DisplayBehaviorEnum displayBehavior, DestoryBehaviorEnum destoryBehavior,
                    SubCutEffectTypeEnum subEffect,
                    DaoTypeEnum daoTypeEnum, float durTime)
 {
     _sceneType       = sceneTypeEnum;
     _subEffect       = subEffect;
     _dataType        = dataType;
     _durTime         = durTime;
     _displayBehavior = displayBehavior;
     _destoryBehavior = destoryBehavior;
     _daoTypeEnum     = daoTypeEnum;
     isKinect         = 0;
 }
Ejemplo n.º 8
0
        private IEnumerator SplashScreenAsync(SceneTypeEnum sceneType)
        {
            yield return(SceneManager.LoadSceneAsync(SceneTypeEnum.SplashScreen.ToString(), LoadSceneMode.Additive));

            OnSceneChanged?.Invoke(SceneTypeEnum.SplashScreen);

            yield return(SceneManager.UnloadSceneAsync(SceneManager.GetActiveScene()));

            SceneManager.SetActiveScene(SceneManager.GetSceneByName("SplashScreen"));

            yield return(new WaitForSeconds(3f));

            yield return(SceneManager.UnloadSceneAsync(SceneManager.GetActiveScene()));

            yield return(SceneManager.LoadSceneAsync(sceneType.ToString(), LoadSceneMode.Additive));

            OnSceneChanged.Invoke(sceneType);

            SceneManager.SetActiveScene(SceneManager.GetSceneByName(sceneType.ToString()));
        }
Ejemplo n.º 9
0
    private IEnumerator WaitSceneLoading(SceneTypeEnum sceneTypeTo, CustomObject customObject, Action action)
    {
        var isLoaded = _loadOperation.isDone;

        while (isLoaded == false)
        {
            yield return(new WaitForEndOfFrame());

            isLoaded = _loadOperation.isDone;
        }

        //Dirty code
        var    sceneAttachedScripts = UnityEngine.Object.FindObjectOfType <BaseScene>();
        IScene sceneTo = sceneAttachedScripts;

        sceneTo.SetDependencies(sceneTypeTo, this);

        sceneTo.Activate();
        action.Invoke();
    }
Ejemplo n.º 10
0
        public List <SceneConfig> GetShowConfigs()
        {
            List <SceneConfig> sceneConfigs = new List <SceneConfig>();

            string showConfigStr = _manager.globalData.GetConfig().ShowConfig;

            SceneTypeEnum[] sceneTypes = new SceneTypeEnum[]
            {
                SceneTypeEnum.CurveStagger,
                SceneTypeEnum.FrontBackUnfold,
                SceneTypeEnum.LeftRightAdjust,
                SceneTypeEnum.MidDisperse,
                SceneTypeEnum.Stars,
                SceneTypeEnum.UpDownAdjustCutEffect,
            };

            DataTypeEnum[] dataTypes = new DataTypeEnum[] {
                DataTypeEnum.Enterprise,
                DataTypeEnum.Activity,
                DataTypeEnum.Product,
            };


            JsonData data = JsonMapper.ToObject(DaoUtil.ConvertShowConfigStr(showConfigStr));

            for (int i = 0; i < data.Count; i++)
            {
                //Debug.Log(data[i]["cuteffect_id"]);
                SceneConfig sceneConfig = new SceneConfig();
                sceneConfig.sceneType = sceneTypes[int.Parse(data[i]["cuteffect_id"].ToString()) - 1];
                sceneConfig.dataType  = dataTypes[int.Parse(data[i]["contcom_type"].ToString())];
                // 设置场景时间
                sceneConfig.durtime = GetSceneDurTime(sceneConfig.sceneType);
                //Debug.Log("sceneType:" + sceneConfig.sceneType + "---dataType:" + sceneConfig.dataType + "---durtime:" + sceneConfig.durtime);
                sceneConfigs.Add(sceneConfig);
            }

            return(sceneConfigs);
        }
Ejemplo n.º 11
0
 public static object GetScenePath(SceneTypeEnum sceneTypeTo)
 {
     return(sceneTypeTo == SceneTypeEnum.Menu);
 }
Ejemplo n.º 12
0
 public void SplashScreen(SceneTypeEnum sceneTypeEnum)
 {
     StartCoroutine(SplashScreenAsync(sceneTypeEnum));
 }
Ejemplo n.º 13
0
 public void SetDependencies(SceneTypeEnum sceneType, ILoadManager loadManager)
 {
     _loadManager = loadManager;
     SceneType    = sceneType;
 }
Ejemplo n.º 14
0
 public void SetDependencies(SceneTypeEnum sceneTypeTo, LoadManager loadManager)
 {
     _sceneImplementation.SetDependencies(sceneTypeTo, loadManager);
 }
Ejemplo n.º 15
0
 public void LoadScene(SceneTypeEnum sceneType)
 {
     SceneManager.LoadScene("Game");
 }