示例#1
0
        private void PatchTechDataEntry()
        {
            CraftDataHandler.SetTechData(TechType, GetBlueprintRecipe());


            if (GroupForPDA != TechGroup.Uncategorized)
            {
                List <TechCategory> categories = new List <TechCategory>();
                CraftData.GetBuilderCategories(GroupForPDA, categories);
                if (categories.Contains(CategoryForPDA))
                {
                    CraftDataHandler.AddToGroup(GroupForPDA, CategoryForPDA, TechType);
                }
                else
                {
                    Logger.Error($"Failed to add {TechType} to {GroupForPDA}/{CategoryForPDA} as it is not a registered combination.");
                }
            }

            if (EncyclopediaEntryData != null)
            {
                PDAEncyclopediaHandler.AddCustomEntry(EncyclopediaEntryData);
            }

            if (!UnlockedAtStart)
            {
                var unlockTech = RequiredForUnlock == TechType.None? this.TechType: RequiredForUnlock;

                KnownTechHandler.SetAnalysisTechEntry(unlockTech, new TechType[1] {
                    TechType
                }, DiscoverMessageResolved);

                if (CompoundTechsForUnlock != null && CompoundTechsForUnlock.Count > 0)
                {
                    KnownTechHandler.SetCompoundUnlock(this.TechType, CompoundTechsForUnlock);
                }

                if (AddScannerEntry)
                {
                    PDAScanner.EntryData entryData = new PDAScanner.EntryData()
                    {
                        key              = unlockTech,
                        blueprint        = TechType,
                        destroyAfterScan = DestroyFragmentOnScan,
                        isFragment       = true,
                        locked           = true,
                        scanTime         = TimeToScanFragment,
                        totalFragments   = FragmentsToScan
                    };

                    if (EncyclopediaEntryData != null)
                    {
                        entryData.encyclopedia = EncyclopediaEntryData.key;
                    }
                    PDAHandler.AddCustomScannerEntry(entryData);
                }
            }
        }
示例#2
0
 void Awake()
 {
     //Singleton stuff
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
    private void Initialise()
    {
        // Variables to be initilaised on start
        PDAH             = FindObjectOfType <PDAHandler>();
        orthographicSize = Camera.main.orthographicSize;

        panBorder      = 20f;
        panSpeed       = 5f;
        panRestriction = 30f;
        panLimit.x     = panRestriction;
        panLimit.y     = panRestriction;
        scrollSpeed    = 3f;

        camLock     = true;
        camInMotion = false;
    }
示例#4
0
 static void PatchPlantPDAEntry(TechType techType, string key, string name, string desc, float scanTime = 3f)
 {
     PDAEncyclopediaHandler.AddCustomEntry(new PDAEncyclopedia.EntryData()
     {
         path  = "Lifeforms/Flora/Sea",
         key   = key,
         nodes = new string[] { "Lifeforms", "Flora", "Sea" }
     });
     PDAHandler.AddCustomScannerEntry(new PDAScanner.EntryData()
     {
         key          = techType,
         encyclopedia = key,
         scanTime     = scanTime,
         isFragment   = false
     });
     LanguageHandler.SetLanguageLine("Ency_" + key, name);
     LanguageHandler.SetLanguageLine("EncyDesc_" + key, desc);
 }
        public static void setFragmentTypeToUnlock(TechType unlockTechType, TechType origFragTechType, TechType substFragTechType, int fragCount, float scanTime)
        {
            init();

            PDAHandler.AddCustomScannerEntry(new PDAScanner.EntryData()
            {
                key              = substFragTechType,
                blueprint        = unlockTechType,
                totalFragments   = fragCount,
                scanTime         = scanTime,
                destroyAfterScan = true,
                locked           = true,
                isFragment       = true
            });

            fragments[origFragTechType] = substFragTechType;
            setUnlockNotification(unlockTechType, origFragTechType);
        }
 // Use this for initialization
 void Start()
 {
     PDA = PDAHandler.instance;
 }