Exemple #1
0
 void Start()
 {
     this.cameras      = FindObjectsOfType <Camera>();
     this.collider     = this.GetComponent <Collider>();
     this.player       = GameObject.FindGameObjectWithTag("Player");
     this.blinkService = player.GetComponent <BlinkService>();
     this.navMesh      = this.GetComponent <NavMeshAgent>();
 }
Exemple #2
0
        static async Task Main()
        {
            WaitForDebugger();

            using GpioController gpio     = new GpioController();
            using var button              = new Button(gpio, 6);
            using var buttonPressService  = new ButtonPressService(button);
            buttonPressService.Clicked   += ButtonClicked;
            buttonPressService.LongPress += ButtonLongPress;
            // button.Pressed += Button_Pressed;
            // button.Released += Button_Released;

            _led5 = new Led(gpio, 5);
            _led5BlinkingService = new BlinkService(_led5);

            await Task.Delay(30000);
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <AppDbContext>(optionsAction: options => {
                options.UseSqlite(connectionString: "DataSource=app.db");
            });
            services.AddDefaultIdentity <IdentityUser>()
            .AddEntityFrameworkStores <AppDbContext>();
            services.AddRazorPages();
            services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; });
            services.AddScoped <AuthenticationStateProvider, ServerAuthenticationStateProvider>();
            services.AddSingleton <WeatherForecastService>();
            // Sistem calisacak
            BlinkService sistemServis = new BlinkService();

            sistemServis.ServiceInit();
            // Sistem basladiktan sonra
            services.AddSingleton <BlinkService>(sistemServis);
        }
Exemple #4
0
 void Start()
 {
     this.blinkService = this.GetComponent <BlinkService>();
 }