예제 #1
0
        public async Task <ActionResult <RobotModel> > PostRobotModel(long id)
        {
            var robot = await _context.Robots.FindAsync(id);

            if (robot is null)
            {
                return(NotFound());
            }

            RobotReset robotReset = new RobotReset();

            robotReset.Reset(robot);

            _context.Entry(robot).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }

            return(NoContent());
        }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        seconds   = 0;
        resetting = false;
        battery   = GetComponent <RobotBattery>();
        flip      = GetComponent <RobotReset>();
        InvokeRepeating("Blink", 0, 0.5f);
        initialPosition = gameObject.transform.position;
        initialRotation = gameObject.transform.rotation;

        GetComponent <Rigidbody>().maxAngularVelocity = 1.5f;
    }