Beispiel #1
0
 public void FixedUpdate()
 {
     if (HighLogic.LoadedSceneIsFlight)
     {
         if (estaactivo)
         {
             if (bapp == null)
             {
                 bapp = FindObjectOfType <MuestraUI>();
             }
             if (conelectricidad)
             {
                 if (concomunicacion)
                 {
                     if (encam2)
                     {
                         Usecam2(rate);
                     }
                     if (encam1)
                     {
                         Usecam(rate);
                         if (moviendo)
                         {
                             if (anglex >= minangle && anglex <= maxangle && anglez >= minangle && anglez <= maxangle)
                             {
                                 Movecam(ratemove);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #2
0
 void NoSignal()
 {
     if (encam2)
     {
         encam2 = false;
     }
     if (encam1)
     {
         encam1 = false;
     }
     _cameraarm1.targetTexture    = null;
     _cameraarm2.targetTexture    = null;
     _cameraarm1.enabled          = false;
     _cameraarm2.enabled          = false;
     MuestraUI.rawImage2.enabled  = false;
     MuestraUI.rawImage22.enabled = false;
     MuestraUI.rawImage23.enabled = true;
     _camera.targetTexture        = null;
     _camera.enabled              = false;
     MuestraUI.rawImage.enabled   = false;
     MuestraUI.rawImage11.enabled = false;
     MuestraUI.rawImage12.enabled = true;
     MuestraUI.UpdateText2("Camera(NO SIGNAL)");
     MuestraUI.UpdateText("Camera(NO SIGNAL)");
     MuestraUI.toggleButton.isOn  = false;
     MuestraUI.toggleButton2.isOn = false;
     return;
 }
Beispiel #3
0
        public void Update()
        {
            if (HighLogic.LoadedSceneIsFlight)
            {
                if (bapp2 == null)
                {
                    bapp2 = FindObjectOfType <ButtonApp>();
                    bapp2.Activado();
                }
                foreach (PartResource reso in resour)
                {
                    if (reso.resourceName == resourceName)
                    {
                        if (reso.amount <= 0)
                        {
                            conelectricidad = false;
                        }
                        else
                        {
                            conelectricidad = true;
                            if (CommNet.VesselControlState.ProbeNone == vessel.connection.ControlState)
                            {
                                concomunicacion = false;
                            }
                            else
                            {
                                concomunicacion = true;
                            }
                        }
                    }
                }
                estaactivo = bapp2.guiactivada;
                if (estaactivo)
                {
                    if (bapp == null)
                    {
                        bapp = FindObjectOfType <MuestraUI>();
                    }

                    anglex = Mathf.Clamp(anglex, minangle, maxangle);
                    anglez = Mathf.Clamp(anglez, minangle, maxangle);
                    if (!conelectricidad)
                    {
                        NoPower();
                    }
                    if (conelectricidad)
                    {
                        if (!concomunicacion)
                        {
                            NoSignal();
                        }
                        if (concomunicacion)
                        {
                            WithPower();
                        }
                    }
                }
            }
        }
Beispiel #4
0
 private void OnToggleOff()
 {
     if (MuestraUI.CoolUICanvas != null)
     {
         FindObjectOfType <CamInsight>().scala = MuestraUI.CoolUICanvas.transform.localScale;
         FindObjectOfType <CamInsight>().posi  = MuestraUI.CoolUICanvas.transform.localPosition;
         FindObjectOfType <CamInsight>().SaveZoom();
         MuestraUI.Destroy();
         guiactivada = false;
     }
 }
Beispiel #5
0
        void WithPower()
        {
            bapp.CheckFov2(_cameraarm1, _cameraarm2);
            bapp.CheckFov(_camera);
            float shininess = Mathf.PingPong(Time.time * 5, 3f);

            MuestraUI.rawImage2.material.SetFloat("_NoiseOffset", shininess);
            MuestraUI.rawImage.material.SetFloat("_NoiseOffset", shininess);
            if (encam2)
            {
                _cameraarm1.enabled          = true;
                _cameraarm2.enabled          = true;
                _cameraarm1.targetTexture    = (RenderTexture)MuestraUI.rawImage2.texture;
                _cameraarm2.targetTexture    = (RenderTexture)MuestraUI.rawImage2.texture;
                MuestraUI.rawImage2.enabled  = true;
                MuestraUI.rawImage22.enabled = false;
                MuestraUI.rawImage23.enabled = false;
                MuestraUI.UpdateText2("Camera Arm (ON)");
                //return;
            }
            if (!encam2)
            {
                _cameraarm1.targetTexture    = null;
                _cameraarm2.targetTexture    = null;
                _cameraarm1.enabled          = false;
                _cameraarm2.enabled          = false;
                MuestraUI.rawImage2.enabled  = false;
                MuestraUI.rawImage22.enabled = true;
                MuestraUI.rawImage23.enabled = false;
                MuestraUI.UpdateText2("Camera Arm (OFF)");
                //return;
            }
            if (encam1)
            {
                _camera.enabled              = true;
                _camera.targetTexture        = (RenderTexture)MuestraUI.rawImage.texture;
                MuestraUI.rawImage.enabled   = true;
                MuestraUI.rawImage11.enabled = false;
                MuestraUI.rawImage12.enabled = false;
                MuestraUI.UpdateText("Camera Insight (ON)");
                //return;
            }
            if (!encam1)
            {
                _camera.targetTexture        = null;
                _camera.enabled              = false;
                MuestraUI.rawImage.enabled   = false;
                MuestraUI.rawImage11.enabled = true;
                MuestraUI.rawImage12.enabled = false;
                MuestraUI.UpdateText("Camera Insight (OFF)");
                //return;
            }
        }
Beispiel #6
0
 void Update()
 {
     if (HighLogic.LoadedSceneIsFlight)
     {
         camin = FindObjectOfType <CamInsight>();
         if (camin == null)
         {
             if (MuestraUI.CoolUICanvas != null)
             {
                 MuestraUI.Destroy();
                 guiactivada = false;
             }
             OnDisable();
         }
     }
 }
Beispiel #7
0
 private void OnToggleOn()
 {
     MuestraUI.ShowGUI();
     guiactivada = true;
 }