Example #1
0
 void Awake()
 {
     instance = this;
     if (HighLogic.LoadedSceneIsEditor)
     {
         if (EditorPartList.Instance)
         {
             EditorPartList.Instance.iconPrefab.gameObject.AddComponent <EditorClickListener>();
         }
     }
     GameEvents.onVesselChange.Add(new EventData <Vessel> .OnEvent(this.OnVesselChange));
 }
Example #2
0
 void Awake()
 {
     instance = this;
     if (HighLogic.LoadedSceneIsEditor)
     {
         if (EditorPartList.Instance)
         {
             EditorPartList.Instance.iconPrefab.gameObject.AddComponent<EditorClickListener>();
         }
     }
     GameEvents.onVesselChange.Add(new EventData<Vessel>.OnEvent(this.OnVesselChange));
 }
Example #3
0
 void Awake()
 {
     instance = this;
     if (HighLogic.LoadedSceneIsEditor) {
       if (EditorPartList.Instance) {
     var iconPrefab = EditorPartList.Instance.partPrefab.gameObject;
     if (iconPrefab.GetComponent<EditorClickListener>() == null) {
       EditorPartList.Instance.partPrefab.gameObject.AddComponent<EditorClickListener>();
     } else {
       Logger.logWarning("Skip adding click listener because it exists");
     }
       }
     }
     GameEvents.onVesselChange.Add(new EventData<Vessel>.OnEvent(this.OnVesselChange));
     ConfigAccessor.ReadFieldsInType(typeof(KISAddonPickup), instance: this);
 }