Beispiel #1
0
        public void DumpRendererLockersInfo()
        {
            bool prevLogValue = Debug.unityLogger.logEnabled;

            Debug.unityLogger.logEnabled = true;

            RenderingController renderingController = FindObjectOfType <RenderingController>();

            if (renderingController == null)
            {
                Debug.Log("RenderingController not found. Aborting.");
                return;
            }

            Debug.Log($"Renderer is locked? {!renderingController.renderingActivatedAckLock.isUnlocked}");
            Debug.Log($"Renderer is active? {CommonScriptableObjects.rendererState.Get()}");

            System.Collections.Generic.HashSet <object> lockIds =
                renderingController.renderingActivatedAckLock.GetLockIdsCopy();

            foreach (var lockId in lockIds)
            {
                Debug.Log($"Renderer is locked by id: {lockId} of type {lockId.GetType()}");
            }

            Debug.unityLogger.logEnabled = prevLogValue;
        }
Beispiel #2
0
        public StlComponent(Game game, PhoneApplicationPage _mainPage)
            : base(game)
        {
            mainPage = _mainPage;

            controller = (RenderingController)this.Game;
        }
    void Start()
    {
        renderingController = this.GetComponent <RenderingController>();
        if (renderingController != null)
        {
            List <float> list_1 = new List <float>();
            list_1.Add(renderingController.NightEnd);
            list_1.Add(renderingController.MorningStart);
            timeChangeRange.Add(list_1);

            List <float> list_2 = new List <float>();
            list_2.Add(renderingController.MorningEnd);
            list_2.Add(renderingController.DayStart);
            timeChangeRange.Add(list_2);

            List <float> list_3 = new List <float>();
            list_3.Add(renderingController.DayEnd);
            list_3.Add(renderingController.DuskStart);
            timeChangeRange.Add(list_3);

            List <float> list_4 = new List <float>();
            list_4.Add(renderingController.DuskEnd);
            list_4.Add(renderingController.NightStart);
            timeChangeRange.Add(list_4);
        }

        clockSelfRotateManager = this.GetComponent <ClockSelfRotateManager>();
        objRainbow             = GameObject.Find("fx_Env_lv00_main_battle_rainbow02");
        GameObject objRs = GameObject.Find("RainSky");

        if (objRs != null)
        {
            rainSky = objRs.GetComponent <RainSky>();
        }
    }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            //Copy test files to isolatedstorage if needed
            if (!IsolatedStorageSettings.ApplicationSettings.Contains("Copiedinitialfiles"))
            {
                IsolatedStorageSettings.ApplicationSettings.Add("Copiedinitialfiles", true);

                var resource = App.GetResourceStream(new Uri("/RepRap Phone Host;component/test.stl", UriKind.Relative));

                var file = IsolatedStorageFile.GetUserStoreForApplication();

                var stream = new IsolatedStorageFileStream("test.stl", System.IO.FileMode.CreateNew, file);

                byte[] bytes = new byte[resource.Stream.Length];

                resource.Stream.Read(bytes, 0, bytes.Length);

                stream.Write(bytes, 0, bytes.Length);

                resource.Stream.Dispose();
                stream.Dispose();

                var resource2 = App.GetResourceStream(new Uri("/RepRap Phone Host;component/test.gcode", UriKind.Relative));

                var stream2 = new IsolatedStorageFileStream("test.gcode", System.IO.FileMode.CreateNew, file);

                bytes = new byte[resource2.Stream.Length];

                resource2.Stream.Read(bytes, 0, bytes.Length);

                stream2.Write(bytes, 0, bytes.Length);

                resource2.Stream.Dispose();
                stream2.Dispose();
            }

            renderingController = XamlGame <RenderingController> .Create("", this);

            //All the pivot item constructrs should be called here
            Construct_StlPivot();
            Construct_SlicerPivot();
            Construct_GCodePivot();
            Construct_GCode_TextPivot();
            Construct_ConnectionPivot();//This has to be called before the controlpivot because the cocontroller gets initialised first
            Construct_ControlPivot();
            Construct_SettingsPivot();
            Construct_FilesPivot();

            BackKeyPress += PhoneApplicationPage_BackKeyPress;

            Values.GCode_Items = FileFinder.findFilesAndCreateList("GCode", ".gcode");
            Values.Stl_Items   = FileFinder.findFilesAndCreateList("Stl", ".stl");

            if (Values.startFileType == "gcode")
            {
                MainPivot.SelectedItem = GCodePivot;
            }
        }
    // Use this for initialization
    public static void MixRenderingController(RenderingController z, RenderingController x, RenderingController y, float t)
    {
        z.LightmapForce       = Mathf.Lerp(x.GetValue(x.LightmapForceCurve, x.LightmapForce), y.GetValue(y.LightmapForceCurve, y.LightmapForce), t);
        z.GlobalEmissionLevel = Mathf.Lerp(x.GetValue(x.GlobalEmissionLevelCurve, x.GlobalEmissionLevel), y.GetValue(y.GlobalEmissionLevelCurve, y.GlobalEmissionLevel), t);
        //z.SkyBoxLerp = Mathf.Lerp(x.GetValue(x.SkyBoxLerpCurve, x.SkyBoxLerp), y.GetValue(y.SkyBoxLerpCurve, y.SkyBoxLerp), t);
        z.SkyBoxLerp                 = Mathf.Lerp(x.SkyBoxLerp, y.SkyBoxLerp, t);
        z.WindForce                  = Mathf.Lerp(x.WindForce, y.WindForce, t);
        z.WindSpeed                  = Mathf.Lerp(x.WindSpeed, y.WindSpeed, t);
        z.FogDensity                 = Mathf.Lerp(x.GetValue(x.FogDensityCurve, x.FogDensity), y.GetValue(y.FogDensityCurve, y.FogDensity), t);
        z.FogStartDistance           = Mathf.Lerp(x.GetValue(x.FogStartDistanceCurve, x.FogStartDistance), y.GetValue(y.FogStartDistanceCurve, y.FogStartDistance), t);
        z.FogHeightFallOut           = Mathf.Lerp(x.GetValue(x.FogHeightFallOutCurve, x.FogHeightFallOut), y.GetValue(y.FogHeightFallOutCurve, y.FogHeightFallOut), t);
        z.FogHeightFallOutPos        = Mathf.Lerp(x.GetValue(x.FogHeightFallOutPosCurve, x.FogHeightFallOutPos), y.GetValue(y.FogHeightFallOutPosCurve, y.FogHeightFallOutPos), t);
        z.VerticalFogDensity         = Mathf.Lerp(x.GetValue(x.VerticalFogDensityCurve, x.VerticalFogDensity), y.GetValue(y.VerticalFogDensityCurve, y.VerticalFogDensity), t);
        z.VerticalFogHeight          = Mathf.Lerp(x.GetValue(x.VerticalFogHeightCurve, x.VerticalFogHeight), y.GetValue(y.VerticalFogHeightCurve, y.VerticalFogHeight), t);
        z.Sky_FalloutModif           = Mathf.Lerp(x.GetValue(x.Sky_FalloutModifCurve, x.Sky_FalloutModif), y.GetValue(y.Sky_FalloutModifCurve, y.Sky_FalloutModif), t);
        z.Sky_FalloutModifHeight     = Mathf.Lerp(x.GetValue(x.Sky_FalloutModifHeightCurve, x.Sky_FalloutModifHeight), y.GetValue(y.Sky_FalloutModifHeightCurve, y.Sky_FalloutModifHeight), t);
        RenderSettings.sun.intensity = z.SunIntensityForMixer = Mathf.Lerp(x.GetValue(x.SunIntensityCurve, x.SunIntensityForMixer), y.GetValue(y.SunIntensityCurve, y.SunIntensityForMixer), t);

        t = Mathf.Pow(t, 0.4545f);
        z.LightmapColor                    = Color.Lerp(x.GetColor(x.LightmapColorGradient, x.LightmapColor), y.GetColor(y.LightmapColorGradient, y.LightmapColor), t);
        z.FogColor                         = Color.Lerp(x.GetColor(x.FogColorGradient, x.FogColor), y.GetColor(y.FogColorGradient, y.FogColor), t);
        z.FogLightColor                    = Color.Lerp(x.GetColor(x.FogLightColorGradient, x.FogLightColor), y.GetColor(y.FogLightColorGradient, y.FogLightColor), t);
        z.CharaLight                       = Color.Lerp(x.GetColor(x.CharaLightGradient, x.CharaLight), y.GetColor(y.CharaLightGradient, y.CharaLight), t);
        z.CharaDark                        = Color.Lerp(x.GetColor(x.CharaDarkGradient, x.CharaDark), y.GetColor(y.CharaDarkGradient, y.CharaDark), t);
        z.CharaSkinDark                    = Color.Lerp(x.GetColor(x.CharaSkinDarkGradient, x.CharaSkinDark), y.GetColor(y.CharaSkinDarkGradient, y.CharaSkinDark), t);
        z.GrassColor                       = Color.Lerp(x.GetColor(x.GrassColorGradient, x.GrassColor), y.GetColor(y.GrassColorGradient, y.GrassColor), t);
        RenderSettings.sun.color           = z.SunColorForMixer = Color.Lerp(x.GetColor(x.SunColorGradient, x.SunColorForMixer), y.GetColor(y.SunColorGradient, y.SunColorForMixer), t);
        RenderSettings.ambientSkyColor     = z.SkyColorForMixer = Color.Lerp(x.GetColor(x.SkyEnvColorGradient, x.SkyColorForMixer), y.GetColor(y.SkyEnvColorGradient, y.SkyColorForMixer), t);
        RenderSettings.ambientEquatorColor = z.EquatorColorForMixer = Color.Lerp(x.GetColor(x.EquatorEnvColorGradient, x.EquatorColorForMixer), y.GetColor(y.EquatorEnvColorGradient, y.EquatorColorForMixer), t);
        RenderSettings.ambientGroundColor  = z.GroundColorForMixer = Color.Lerp(x.GetColor(x.GroundEnvColorGradient, x.GroundColorForMixer), y.GetColor(y.GroundEnvColorGradient, y.GroundColorForMixer), t);
    }
Beispiel #6
0
        public IEnumerator ActivateAndDeactivateWithKernelRenderingToggleEvents()
        {
            RenderingController renderingController = GameObject.FindObjectOfType <RenderingController>();

            renderingController.DeactivateRendering();
            Assert.IsFalse(cameraController.camera.enabled);

            yield return(null);

            renderingController.renderingActivatedAckLock.RemoveAllLocks();
            renderingController.ActivateRendering();
            Assert.IsTrue(cameraController.camera.enabled);
        }
 public override void Mix(VMValue _a, float blend)
 {
     if (_a == null)
     {
         Debug.LogError("未添加RenderingController");
         return;
     }
     if (_a is RenderingController)
     {
         RenderingController a = (RenderingController)_a;
         MixRenderingController(this, this, a, blend);
     }
     else
     {
         Debug.LogError(string.Format("请清除{0}的ShaderSetter", _a.gameObject.name));
     }
 }