Example #1
0
    new protected virtual void Update()
    {
        base.Update();

        _time += Time.deltaTime;

        if (_time > _cooldown / GameSettings.IncomeSpeedModifier)
        {
            Iron.Add(_baseIncomeIron);
            _time = 0;
        }
    }
        private IEnumerator ReloadTimer()
        {
            float timer = 0;

            while (timer <= weaponData.ReloadTime)
            {
                timer += Time.deltaTime;
                yield return(null);
            }
            //Debug.LogError("RELOAD COMPLETE");
            ammo.Add(weaponData.MaxAmmo);
            isReloading = false;
        }
Example #3
0
        private IEnumerator ReloadTimer()
        {
            float timer = 0f;

            while (timer <= weaponData.ReloadTime)
            {
                timer += Time.deltaTime;
                yield return(null);
            }
            //Debug.LogError("Reload Complete");
            meshRenderer.material.color = Color.white;
            ammo.Add(weaponData.MaxAmmo);
            isReloading = false;
        }
Example #4
0
        /// <summary>
        /// Constructs a server with the specified configuration that
        /// listens to the given ports.
        /// </summary>
        /// <param name="config">the configuration, or <code>null</code> for default</param>
        /// <param name="ports">the ports to bind to</param>
        public CoapServer(ICoapConfig config, params Int32[] ports)
        {
            _config    = config ?? CoapConfig.Default;
            _root      = new RootResource(this);
            _deliverer = new ServerMessageDeliverer(_config, _root);

            Resource wellKnown = new Resource(".well-known", false);

            wellKnown.Add(new DiscoveryResource(_root));
            _root.Add(wellKnown);

            foreach (Int32 port in ports)
            {
                Bind(port);
            }
        }
Example #5
0
        public CoapServer(ICoapConfig config, IResource rootResource, System.Net.EndPoint endPoint, params int[] ports)
        {
            Config     = config ?? CoapConfig.Default;
            _root      = rootResource ?? new RootResource(this);
            _deliverer = new ServerMessageDeliverer(Config, _root);

            Resource wellKnown = new Resource(".well-known", false);

            wellKnown.Add(new DiscoveryResource(_root));
            _root.Add(wellKnown);

            _endPointSupplied = endPoint;
            foreach (int port in ports)
            {
                Bind(port);
            }
        }
        public void Setup()
        {
            Log.LogManager.Level = Log.LogLevel.Fatal;
            _root = new Resource(String.Empty);
            Resource sensors = new Resource("sensors");
            Resource temp = new Resource("temp");
            Resource light = new Resource("light");
            _root.Add(sensors);
            sensors.Add(light);
            sensors.Add(temp);

            sensors.Attributes.Title = "Sensor Index";
            temp.Attributes.AddResourceType("temperature-c");
            temp.Attributes.AddInterfaceDescription("sensor");
            temp.Attributes.Add("foo");
            temp.Attributes.Add("bar", "one");
            temp.Attributes.Add("bar", "two");
            light.Attributes.AddResourceType("light-lux");
            light.Attributes.AddInterfaceDescription("sensor");
        }
Example #7
0
        public void Setup()
        {
            Log.LogManager.Level = Log.LogLevel.Fatal;
            _root = new Resource(String.Empty);
            Resource sensors = new Resource("sensors");
            Resource temp    = new Resource("temp");
            Resource light   = new Resource("light");

            _root.Add(sensors);
            sensors.Add(light);
            sensors.Add(temp);

            sensors.Attributes.Title = "Sensor Index";
            temp.Attributes.AddResourceType("temperature-c");
            temp.Attributes.AddInterfaceDescription("sensor");
            temp.Attributes.Add("foo");
            temp.Attributes.Add("bar", "one");
            temp.Attributes.Add("bar", "two");
            light.Attributes.AddResourceType("light-lux");
            light.Attributes.AddInterfaceDescription("sensor");
        }
 public async Task Add(Resource Objeto)
 {
     await _IResource.Add(Objeto);
 }