private Task MoveField(int from, int to) { var fromField = _fieldManager.Get(from); var toField = _fieldManager.Get(to); return(Task.WhenAll(fromField .GetObjects <FieldUser>() .ToList() .Select(u => toField.Enter(u, 0)))); }
/// <summary> /// OnTriggerEnter is called when the Collider other enters the trigger. /// </summary> /// <param name="other">The other Collider involved in this collision.</param> void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { FieldManager.Get().CreateNewBlock(); } }
public Continent(ITemplateManager templateManager, FieldManager fieldManager, ContinentTemplate template) { Template = template; _templateManager = templateManager; StartShipMoveField = fieldManager.Get(template.StartShipMoveFieldID); WaitField = fieldManager.Get(template.WaitFieldID); MoveField = fieldManager.Get(template.MoveFieldID); if (template.CabinFieldID.HasValue) { CabinField = fieldManager.Get(template.CabinFieldID.Value); } EndField = fieldManager.Get(template.EndFieldID); EndShipMoveField = fieldManager.Get(template.EndShipMoveFieldID); var now = DateTime.Now; NextBoarding = now .AddMinutes(now.Minute % Template.Term == 0 ? 0 : Template.Term - now.Minute % Template.Term) .AddMinutes(Template.Delay) .AddSeconds(-now.Second); ResetEvent(); }