コード例 #1
0
        public override void Initialize(ModuleWaterfallFX host)
        {
            base.Initialize(host);

            engineController = host.GetComponents <ModuleEngines>().ToList().Find(x => x.engineID == host.engineID);
            if (engineController == null)
            {
                engineController = host.GetComponent <ModuleEngines>();
            }

            if (engineController == null)
            {
                Utils.LogError("[EngineEventController] Could not find engine controller on Initialize");
            }

            if (eventName == "flameout")
            {
                eventReady = engineController.EngineIgnited;
                if (engineController.EngineIgnited)
                {
                    enginePreState = true;
                }
            }
            if (eventName == "ignition")
            {
                eventReady = !engineController.EngineIgnited;
                if (engineController.EngineIgnited)
                {
                    enginePreState = false;
                }
            }
        }
コード例 #2
0
ファイル: RCSController.cs プロジェクト: zorg2044/Waterfall
        public override void Initialize(ModuleWaterfallFX host)
        {
            base.Initialize(host);

            rcsController = host.GetComponents <ModuleRCSFX>().ToList().First();
            if (rcsController == null)
            {
                rcsController = host.GetComponent <ModuleRCSFX>();
            }

            if (rcsController == null)
            {
                Utils.LogError("[RCSController] Could not find ModuleRCSFX on Initialize");
            }
        }
コード例 #3
0
        public override void Initialize(ModuleWaterfallFX host)
        {
            base.Initialize(host);

            engineController = host.GetComponents <ModuleEngines>().ToList().Find(x => x.engineID == host.engineID);
            if (engineController == null)
            {
                engineController = host.GetComponent <ModuleEngines>();
            }

            if (engineController == null)
            {
                Utils.LogError("[ThrottleController] Could not find engine controller on Initialize");
            }
        }
コード例 #4
0
        public override void Initialize(ModuleWaterfallFX host)
        {
            base.Initialize(host);

            engineController = host.GetComponents <ModuleEngines>().FirstOrDefault(x => x.engineID == engineID);
            if (engineController == null)
            {
                Utils.Log($"[{nameof(CustomPullController)}]: Could not find engine ID {engineID}, using first module if available");
                engineController = host.GetComponent <ModuleEngines>();
            }

            if (engineController == null)
            {
                Utils.LogError($"[{nameof(CustomPullController)}]: Could not find any {nameof(ModuleEngines)} to use with {nameof(CustomPullController)} named {name}, effect controller will not do anything");
                return;
            }

            pullValueMethod = FindSuitableMemberOnEnginesModule();
        }
コード例 #5
0
        public override void Initialize(ModuleWaterfallFX host)
        {
            base.Initialize(host);

            rcsController = host.GetComponents <ModuleRCSFX>().ToList().Find(x => x.thrusterTransformName == thrusterTransformName);
            if (rcsController == null)
            {
                rcsController = host.GetComponent <ModuleRCSFX>();
            }

            if (rcsController == null)
            {
                Utils.LogError("[RCSController] Could not find ModuleRCSFX on Initialize");
                return;
            }

            currentThrottle = new List <float>(rcsController.thrusterTransforms.Count);
            for (int i = 0; i < rcsController.thrusterTransforms.Count; i++)
            {
                currentThrottle.Add(0f);
            }
        }