Platform.Update C# (CSharp) 메소드

Update() 공개 메소드

public Update ( ) : void
리턴 void
    void Update()
    {
        if( StartDelayOn )
        {
            StartCountdown -= Time.deltaTime;
            if( StartCountdown < 0.0f )
            {
                StartDelayOn = false;
                Active = true;
            }
        }

        if( Active )
        {
            position += Direction * Time.deltaTime * Speed;
            CurrentTime += Time.deltaTime;

            if( position.y > StopHeight && UseStopHeight )
            {
                Active = false;
                position.y = StopHeight;
            }

            if( CurrentTime > StopTime && !UseStopHeight )
                Active = false;

            transform.position = position;
        }
    }

Usage Example

예제 #1
0
        public async Task<IActionResult> UpdatePlatform([FromBody]PlatformEditViewModel model)
        {
            Platform platform = await DataContext.Store.GetOneAsync<Platform>(p => p.Id == model.Id);

            if (platform == null) return NotFound("No platform exists with the given Id");

            platform.Update(Mapper.Map<Platform>(model));

            if (!await DataContext.Store.UpdateOneAsync(platform))
                return BadRequest("An error occured while updating the platform");

            return Ok();
        }
All Usage Examples Of Platform::Update