예제 #1
0
 void Awake()
 {
     if (I == null)
     {
         I = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #2
0
        public static Background CreateBackground(ContentManager content, Scene scene)
        {
            Dictionary <string, Texture2D> backgroundImages = new Dictionary <string, Texture2D>();

            foreach (var mapInfo in MapManager.Maps)
            {
                try
                {
                    backgroundImages.Add(mapInfo.Name, BackgroundLoader.Load(mapInfo.Name));
                }
                catch (ContentLoadException)
                {
                    backgroundImages.Add(mapInfo.Name, BackgroundLoader.Load("Default"));
                }
            }

            return(new Background(scene, backgroundImages));
        }
 private void Start()
 {
     if (i == null)
     {
         i = this;
     }
     else
     {
         LoadBackground(CurrentBackground);
         enabled = false;
     }
     backgrounds = Resources.LoadAll <BackgroundSet>("Skin");
     current     = PlayerPrefs.GetInt("background");
     if (current > backgrounds.Length)
     {
         current = 0;
     }
     LoadBackground(backgrounds[current]);
 }
예제 #4
0
 public GameMain(GraphicsDeviceManager graphics, ContentManager content, GraphicsDevice graphicsDevice)
 {
     graphicsMain       = graphics;
     contentMain        = content;
     graphicsDeviceMain = graphicsDevice;
     //Nastavimo velikost igralnega zaslona
     graphicsMain.PreferredBackBufferWidth  = screenWidth;
     graphicsMain.PreferredBackBufferHeight = screenHeight;
     graphicsMain.ApplyChanges();
     LoadContent();
     //Inicializacija kamnov in metkov
     numberOfRocks   = 1;
     numberOfBullets = 3;
     playerHP        = 3;
     //Čas od kadar smo vstrelili
     timeSinceShot = 0;
     // Init sprites
     npc_testing = new AI(graphicsDeviceMain, 3);
     //ufo_testing = new AIUFO(this.GraphicsDevice);
     character           = new PlayerCharacter(graphicsDeviceMain);
     my_bullets          = new List <Projectile>();
     my_rocks            = new List <Planetoids>();
     gameLogic           = new GameLogic(numberOfRocks, playerHP, character, my_rocks);
     ui_rocks_NUMOFROCKS = new ScreenUI(contentMain, 210, 20, "NUM.OF ROCKS");
     ui_rocks_REMAIN     = new ScreenUI(contentMain, 210, 40, gameLogic.getNumRocks().ToString());
     ui_score_SCORE      = new ScreenUI(contentMain, 55, 20, "SCORE");
     ui_score_NUMS       = new ScreenUI(contentMain, 55, 40, gameLogic.getScore().ToString());
     ui_playerHP         = new ScreenUI(graphicsDeviceMain, screenWidth - 100, 40, 3);
     ui_but_back         = new ScreenUI(graphicsDeviceMain, screenWidth - 150, 40);
     ui_playerHP_NUMS    = new ScreenUI(contentMain, screenWidth - 60, 40, "x " + playerHP.ToString());
     ui_wave_NUMS        = new ScreenUI(contentMain, screenWidth / 2, 40, "WAVE: " + gameLogic.getWave());
     my_backs            = new BackgroundLoader(graphicsDeviceMain);
     for (int i = 0; i < numberOfRocks; i++)
     {
         my_rocks.Add(new Planetoids(graphicsDeviceMain));
     }
     for (int j = 0; j < numberOfBullets; j++)
     {
         my_bullets.Add(new Projectile(graphicsDeviceMain, contentMain));
     }
 }
예제 #5
0
	void Awake() {
		instance = this;
	}
예제 #6
0
 public void RemoveBackgroundLoader(BackgroundLoader loader)
 {
     throw new NotImplementedException();
 }
예제 #7
0
 public static Tuple <Image, Color> LoadBackground(BoardBackground type)
 {
     return(BackgroundLoader.LoadBackground(type));
 }
예제 #8
0
 public override void _Ready()
 {
     instance = this;
 }
예제 #9
0
        private static SrmDocument CreateLibraryDocument(SrmSettings settings, string textFasta, bool peptideList,
                                                         TestDocumentContainer docContainer, BackgroundLoader libraryManager, out int startRev)
        {
            startRev = 0;
            SrmDocument document = new SrmDocument(SrmSettingsList.GetDefault0_6());

            Assert.IsTrue(docContainer.SetDocument(document, null));

            // Register after first set document
            libraryManager.Register(docContainer);

            // Add libraries
            SrmDocument docLibraries = document.ChangeSettings(settings);

            ++startRev;

            // Add some FASTA
            IdentityPath path     = IdentityPath.ROOT;
            SrmDocument  docFasta = docLibraries.ImportFasta(new StringReader(textFasta), peptideList, path, out path);

            ++startRev;

            // Until libraries are loaded, only the sequences should appear
            if (!peptideList)
            {
                AssertEx.IsDocumentState(docFasta, startRev, textFasta.Count(c => c == '>'), 0, 0);
            }

            // Run the library load
            Assert.IsTrue(docContainer.SetDocument(docFasta, document, true));
            ++startRev;

            // After library load completes peptides and transitions should have expected library info
            SrmDocument docLoaded = docContainer.Document;

            // Check expected library inforamation
            foreach (var nodePeptide in docLoaded.Peptides)
            {
                Assert.IsNull(nodePeptide.Rank);
            }
            foreach (var nodeTran in docLoaded.PeptideTransitions)
            {
                Assert.IsTrue(nodeTran.HasLibInfo);
                Assert.IsTrue(nodeTran.LibInfo.Rank <= 3);
            }

            return(docLoaded);
        }
예제 #10
0
 void Awake()
 {
     instance = this;
 }
예제 #11
0
        private void LoadClient()
        {
            UserHelper.Initialize(this);

            BackgroundLoader.Load();
        }
예제 #12
0
 private void UnloadClient()
 {
     // No point in uninitializing the UserHelper since its so small. Might add it later.
     BackgroundLoader.Unload();
 }