Esempio n. 1
0
        /*
         * Function name: OnStart
         * Purpose: This overrides the OnStart functionality. This function will be called once
         * at the start of the game directly after a scene load. In this case, the function will
         * instatiate the GUI.
         */
        public override void OnStart(StartState state)
        {
            if (!IsSmallOptics)
            {
                //tie-in with Firespitter.
                opticsAnimate = GetComponent <ModuleAnimateGeneric>();
            }
            else if (IsSmallOptics && !SmallApertureOpen)
            {
                Events["OpenSmallAperture"].active = true;
            }

            //Attempt to instantiate the GUI
            Transform temp = part.FindModelTransform(CameraTransformName);

            try
            {
                TelescopeControlMenu = new TelescopeMenu(temp);
                TelescopeControlMenu.scienceMultiplier = this.scienceMultiplier;
                TelescopeControlMenu.SetSmallOptics(IsSmallOptics);
                TelescopeControlMenu.SetScopeOpen(IsFunctional);
                if (!IsSmallOptics)
                {
                    TelescopeControlMenu.SetAperature(opticsAnimate);
                }
            }
            catch (Exception E)
            {
                //Error = true;
                Debug.Log("CactEye 2: Exception 1:  Was not able to create the Telescope Control Menu object. You should try re-installing CactEye2 and ensure that old versions of CactEye are deleted.");
                Debug.Log(E.ToString());
                Debug.Log(temp.ToString());
            }

            if (IsSmallOptics && SmallApertureOpen && !IsDamaged)
            {
                IsFunctional = true;
            }

            if (CactEyeConfig.DebugMode)
            {
                Debug.Log("CactEye 2: Debug: SmallApertureOpen is " + SmallApertureOpen.ToString());
                Debug.Log("CactEye 2: Debug: IsSmallOptics is " + IsSmallOptics.ToString());
                Debug.Log("CactEye 2: Debug: IsFunctional is " + IsFunctional.ToString());
                Debug.Log("CactEye 2: Debug: IsDamaged is " + IsDamaged.ToString());
            }
        }
Esempio n. 2
0
        /*
         * Function name: OnStart
         * Purpose: This overrides the OnStart functionality. This function will be called once
         * at the start of the game directly after a scene load. In this case, the function will
         * instatiate the GUI.
         */
        public override void OnStart(StartState state)
        {
            if (!IsSmallOptics)
            {
                //tie-in with Firespitter.
                opticsAnimate = GetComponent<ModuleAnimateGeneric>();
            }
            else if (IsSmallOptics && !SmallApertureOpen)
            {
                Events["OpenSmallAperture"].active = true;
            }

            //Attempt to instantiate the GUI
            Transform temp = part.FindModelTransform(CameraTransformName);
            try
            {
                TelescopeControlMenu = new TelescopeMenu(temp);
            }
            catch (Exception E)
            {
                //Error = true;
                Debug.Log("CactEye 2: Exception 1:  Was not able to create the Telescope Control Menu object. You should try re-installing CactEye2 and ensure that old versions of CactEye are deleted.");
                Debug.Log(E.ToString());
                Debug.Log(temp.ToString());
            }

            if (IsSmallOptics && SmallApertureOpen && !IsDamaged)
            {
                IsFunctional = true;
            }

            if (CactEyeConfig.DebugMode)
            {
                Debug.Log("CactEye 2: Debug: SmallApertureOpen is " + SmallApertureOpen.ToString());
                Debug.Log("CactEye 2: Debug: IsSmallOptics is " + IsSmallOptics.ToString());
                Debug.Log("CactEye 2: Debug: IsFunctional is " + IsFunctional.ToString());
                Debug.Log("CactEye 2: Debug: IsDamaged is " + IsDamaged.ToString());
            }
        }