Пример #1
0
 public void Awake()
 {
     if (Locator == null)
     {
         Locator = GetComponent <CameraLocator>();
     }
     if (useSelfModelHighlight)
     {
         HighlitTarget = new Transform[] { transform };
     }
 }
Пример #2
0
        public BunnyHopGame()
        {
            config   = new Config();
            database = new InMemoryDatabase();
            ConfigLocator.Provide(config);
            ContentLocator.Provide(Content);
            InMemoryDatabaseLocator.Provide(database);

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = ConfigLocator.Config.VirtualWidth * ConfigLocator.Config.Scale;
            graphics.PreferredBackBufferHeight = ConfigLocator.Config.VirtualHeight * ConfigLocator.Config.Scale;
            graphics.PreferMultiSampling       = false;
            graphics.ApplyChanges();
            GraphicsLocator.Provide(graphics);

            var viewportAdapter = new BoxingViewportAdapter(Window,
                                                            GraphicsDevice,
                                                            ConfigLocator.Config.VirtualWidth,
                                                            ConfigLocator.Config.VirtualHeight);

            camera = new Camera2D(viewportAdapter);
            CameraLocator.Provide(camera);

            soundEffects = new List <SoundEffect>();
            SoundLocator.Provide(soundEffects);

            Content.RootDirectory = "Content";
            stateStack            = new Stack <State>();
            stateStack.Push(new SplashState());

            //https://docs.microsoft.com/pt-br/dotnet/api/system.globalization.cultureinfo.currentculture?view=netcore-3.1
            //CultureInfo culture = new CultureInfo("ko-KR", false); // us-EN ko-KR ja-JP
            //Thread.CurrentThread.CurrentCulture = culture;
            //Thread.CurrentThread.CurrentUICulture = culture;
            //Resources.Culture = CultureInfo.CurrentCulture;
            //Debug.Print(CultureInfo.CurrentCulture.Name);
            //Debug.Print(CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
            //Debug.Print(Resources.Culture.Name);
        }
 public void RemovePlayerTag(CameraLocator tag)
 {
     objList.Remove(tag);
 }
 public void AddPlayerTag(CameraLocator tag)
 {
     objList.Add(tag);
 }