Пример #1
0
 public KnowledgeTabUI GetKnowledgeTabUI()
 {
     if (knowledgeTabUI == null)
     {
         knowledgeTabUI = Instantiate(Resources.Load <GameObject>("UIPrefs/knowledgeTab"), transform).GetComponent <KnowledgeTabUI>();
         knowledgeTabUI.Prepare(Knowledge.GetCurrent(), this);
     }
     return(knowledgeTabUI);
 }
Пример #2
0
    public void Load()
    {
        if (current != null)
        {
            return;
        }
        current = this;
        DefineMaterialPack();
        LoadMaterials();
        useIlluminationSystem = !shadowCasting;
        if (qualityLevel != 0) // dependency : change quality level()
        {
            buildEmitter     = Instantiate(Resources.Load <ParticleSystem>("buildEmitter"));
            lifepowerEmitter = Instantiate(Resources.Load <ParticleSystem>("lifepowerEmitter"));
        }
        inactiveShips = new List <Ship>();

        lr_red_material   = Resources.Load <Material>("Materials/GUI_Red");
        lr_green_material = Resources.Load <Material>("Materials/GUI_Green");

        zoneCube = Instantiate(Resources.Load <Transform>("Prefs/zoneCube"), transform);
        zoneCube.gameObject.SetActive(false);

        default_material                = Resources.Load <Material>("Materials/Default");
        darkness_material               = Resources.Load <Material>("Materials/Darkness");
        energyMaterial_disabled         = Resources.Load <Material>("Materials/UnchargedMaterial");
        verticalBillboardMaterial       = Resources.Load <Material>("Materials/VerticalBillboard");
        verticalWavingBillboardMaterial = Resources.Load <Material>("Materials/VerticalWavingBillboard");

        billboardShadedMaterial = Resources.Load <Material>("Materials/Advanced/shadedBillboard");
        billboardMaterial       = Resources.Load <Material>("Materials/BillboardMaterial");
        // android errors here:
        // celestialBillboardMaterial = new Material(Shader.Find("Custom/CelestialBillboard"));
        // celestialBillboardMaterial.SetColor("_MainColor", Color.white);
        starsBillboardMaterial     = Resources.Load <Material>("Materials/StarsBillboardMaterial");
        celestialBillboardMaterial = new Material(starsBillboardMaterial);
        celestialBillboardMaterial.SetFloat("_Tick", 1);

        //mineElevator_pref = Resources.Load<GameObject>("Structures/MineElevator");
        gui_overridingSprite = LoadOverridingSprite();
        starsSprites         = Resources.LoadAll <Sprite>("Textures/stars");

        GameMaster.realMaster.labourUpdateEvent += LabourUpdate;
        energyMaterial = Resources.Load <Material>("Materials/ChargedMaterial");

        if (GameMaster.realMaster?.mainChunk != null)
        {
            GameMaster.realMaster.mainChunk.SetShadowCastingMode(shadowCasting);
        }
        if (useIlluminationSystem)
        {
            lightPoolMaterials           = new Dictionary <LightPoolInfo, Material>();
            MAX_MATERIAL_LIGHT_DIVISIONS = QualitySettings.GetQualityLevel() == 0 ? (byte)8 : (byte)16;
        }

        var rrs = Component.FindObjectsOfType <Renderer>();

        //if (rrs != null && rrs.Length != 0) ReplaceMaterials(rrs, useAdvancedMaterials);
        if (GameMaster.realMaster?.IsInTestMode ?? false)
        {
            AnnouncementCanvasController.MakeAnnouncement("Pool master loaded");
        }

        KnowledgeTabUI.PreparePartsTexture();
    }