private void Start()
        {
            if (!_coroutineStarted)
            {
                base.InvokeRepeating(nameof(UpdateDisplay), DelayedStartTime * 3f, RepeatingUpdateInterval);
            }

            DisplayLanguagePatching.AdditionPatching();

            if (FindAllComponents() == false)
            {
                QuickLogger.Error("// ============== Error getting all Components ============== //");
                return;
            }

            _animatorController = this.transform.GetComponent <CubeGeneratorAnimator>();

            if (_animatorController == null)
            {
                QuickLogger.Error("Animator component not found on the GameObject.");
            }

            _mono = this.transform.GetComponent <CubeGeneratorMono>();

            if (_mono == null)
            {
                QuickLogger.Error("CubeGeneratorMono component not found on the GameObject.");
            }

            _initialized = true;

            UpdateSpeedModeText();

            BootScreen();
        }
Beispiel #2
0
        public override GameObject GetGameObject()
        {
            var        prefab       = GameObject.Instantiate(_ionCubeGenPrefab);
            GameObject consoleModel = prefab.FindChild("model");

            // Update sky applier
            SkyApplier skyApplier = prefab.AddComponent <SkyApplier>();

            skyApplier.renderers = consoleModel.GetComponentsInChildren <MeshRenderer>();
            skyApplier.anchorSky = Skies.Auto;

            //Add the constructible component to the prefab
            Constructable constructible = prefab.AddComponent <Constructable>();

            CreateDisplayedIonCube(prefab);

            constructible.allowedInBase           = true;  // Only allowed in Base
            constructible.allowedInSub            = false; // Not allowed in Cyclops
            constructible.allowedOutside          = false;
            constructible.allowedOnCeiling        = false;
            constructible.allowedOnGround         = true; // Only on ground
            constructible.allowedOnWall           = false;
            constructible.allowedOnConstructables = false;
            constructible.controlModelState       = true;
            constructible.rotationEnabled         = true;
            constructible.techType = this.TechType;
            constructible.model    = consoleModel;

            //Add the prefabIdentifier
            PrefabIdentifier prefabID = prefab.AddComponent <PrefabIdentifier>();

            prefabID.ClassId = this.ClassID;

            // Add the custom component
            CubeGeneratorMono cubeGenerator = prefab.AddComponent <CubeGeneratorMono>(); // Moved to the bottom to allow constructible to be added

            CubeGeneratorAnimator cubeGeneratorAnimator = prefab.AddComponent <CubeGeneratorAnimator>();

            IonGeneratorDisplay cubeGeneratorDisplay = prefab.AddComponent <IonGeneratorDisplay>();

            FMOD_CustomLoopingEmitter FMOD_CustomLoopingEmitter = prefab.AddComponent <FMOD_CustomLoopingEmitter>();

            return(prefab);
        }