Beispiel #1
0
    protected override void OnSpawn()
    {
        base.OnSpawn();
        conditionManager = FindLaunchConditionManager();
        Spacecraft spacecraftFromLaunchConditionManager = SpacecraftManager.instance.GetSpacecraftFromLaunchConditionManager(conditionManager);

        if (spacecraftFromLaunchConditionManager != null)
        {
            SetParentRocketName(spacecraftFromLaunchConditionManager.GetRocketName());
        }
        RegisterWithConditionManager();
        KSelectable component = GetComponent <KSelectable>();

        if ((UnityEngine.Object)component != (UnityEngine.Object)null)
        {
            component.AddStatusItem(Db.Get().BuildingStatusItems.RocketName, this);
        }
        if ((UnityEngine.Object)conditionManager != (UnityEngine.Object)null && conditionManager.GetComponent <KPrefabID>().HasTag(GameTags.RocketNotOnGround))
        {
            OnLaunch(null);
        }
        Subscribe(-1056989049, OnLaunchDelegate);
        Subscribe(238242047, OnLandDelegate);
        Subscribe(1502190696, DEBUG_OnDestroyDelegate);
        FixSorting();
        AttachableBuilding component2 = GetComponent <AttachableBuilding>();

        component2.onAttachmentNetworkChanged = (Action <AttachableBuilding>)Delegate.Combine(component2.onAttachmentNetworkChanged, new Action <AttachableBuilding>(OnAttachmentNetworkChanged));
        if ((UnityEngine.Object)bgAnimFile != (UnityEngine.Object)null)
        {
            AddBGGantry();
        }
    }
Beispiel #2
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);
                     }
                 }
             }
         }
     }
 }
Beispiel #3
0
    public void OnConditionManagerTagsChanged(object data)
    {
        KPrefabID component = conditionManager.GetComponent <KPrefabID>();

        if (component.HasTag(GameTags.RocketNotOnGround))
        {
            OnLaunch(null);
        }
    }