Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        PhxRuntimeEnvironment rt = PhxGameRuntime.GetEnvironment();

        if (rt != null)
        {
            Percentage = Mathf.Lerp(Percentage, rt.GetLoadingProgress(), Time.deltaTime * PercentageSpeed);
            LoadIcon.material.SetFloat("_Percent", Percentage);
        }

        if (ImageSet)
        {
            if (FadeImagePlayback < FadeImageDuration)
            {
                FadeImagePlayback += Time.deltaTime;
            }

            LoadImage.color = Color.Lerp(Color.black, Color.white, FadeImagePlayback / FadeImageDuration);
        }

        if (State == LSState.FadeIn && FadeScreenPlayback < FadeScreenDuration)
        {
            FadeScreenPlayback += Time.deltaTime;
        }
        else if (State == LSState.FadeOut && FadeScreenPlayback > 0.0)
        {
            FadeScreenPlayback -= Time.deltaTime;
        }

        CVGroup.alpha = FadeScreenPlayback / FadeScreenDuration;
    }
Beispiel #2
0
    void OnGUI()
    {
        PhxRuntimeEnvironment env = PhxGameRuntime.GetEnvironment();

        if (!Application.isPlaying || PhxGameRuntime.Instance == null || env == null)
        {
            EditorGUILayout.LabelField("Game is not running");
            return;
        }

        PhxPath gamePath = PhxGameRuntime.GamePath;

        EditorGUILayout.LabelField("Environment Path", env.Path - gamePath);
        EditorGUILayout.LabelField("Fallback Path", env.FallbackPath - gamePath);
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Environment Stage", env.Stage.ToString());
        EditorGUILayout.Space();

        foreach (var lvl in env.LVLs)
        {
            EditorGUILayout.LabelField(lvl.RelativePath, "Loaded", lvl.bIsFallback ? FallbackLVLStyle : EnvLVLStyle);
        }
        foreach (var lvl in env.LoadingLVLs)
        {
            EditorGUILayout.LabelField(lvl.PathPartial, string.Format("{0:0.} %", env.GetProgress(lvl.Handle) * 100.0f), lvl.bIsFallback ? FallbackLVLStyle : EnvLVLStyle);
        }
    }