示例#1
0
 public override void Update(float dt)
 {
     foreach (Entry entry in entries)
     {
         Entry current = entry;
         if (!((Object)current.rocketModule == (Object)null))
         {
             LaunchConditionManager conditionManager = current.rocketModule.conditionManager;
             if (!((Object)conditionManager == (Object)null))
             {
                 LaunchableRocket component = conditionManager.GetComponent <LaunchableRocket>();
                 if (!((Object)component == (Object)null))
                 {
                     if (component.isLanding)
                     {
                         current.ev.setParameterValueByIndex(current.parameterIdx, 1f);
                     }
                     else
                     {
                         current.ev.setParameterValueByIndex(current.parameterIdx, 0f);
                     }
                 }
             }
         }
     }
 }
示例#2
0
 protected override void OnSpawn()
 {
     base.OnSpawn();
     launchable = GetComponent <LaunchableRocket>();
     FindModules();
     GetComponent <AttachableBuilding>().onAttachmentNetworkChanged = delegate
     {
         FindModules();
     };
     Subscribe(-1582839653, OnTagsChanged);
 }
示例#3
0
            /// <summary>
            /// Applied after OnSpawn runs.
            /// </summary>
            internal static void Postfix(LaunchableRocket __instance)
            {
                var          smi  = __instance.smi;
                const string name = nameof(LaunchableRocket.States.not_grounded.space);

                if (smi != null && (smi.GetCurrentState().name?.EndsWith(name) ?? false))
                {
#if DEBUG
                    PUtil.LogDebug("Scheduling rocket fix task");
#endif
                    GameScheduler.Instance.Schedule("FixRocketAnims", 0.5f, (_) => {
                        var parts = smi.master.parts;
                        if (smi.GetCurrentState().name?.EndsWith(name) ?? false)
                        {
                            // Hide them!
                            foreach (var part in parts)
                            {
                                part.GetComponent <KBatchedAnimController>().enabled = false;
                            }
                        }
                    });
                }
            }