Skip to content

Commit

Permalink
Merge branch 'feature/refactoring' of https://github.com/techno-dwarf…
Browse files Browse the repository at this point in the history
…-works/better-locators into feature/refactoring
  • Loading branch information
OpOpYaDev committed Jul 6, 2024
2 parents 8cb1ac0 + 901c820 commit bb6fa8c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 402 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Assets/BetterLocators/Runtime/Properties/ServiceProperty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#if BETTER_SERVICES
using Better.Services.Runtime.Interfaces;

namespace Better.Locators.Runtime
{
public sealed class ServiceProperty<T> where T : IService
{
private T _cachedService;

public T CachedService
{
get
{
if (_cachedService == null)
{
_cachedService = ServiceLocator.Get<T>();
}

return _cachedService;
}
}

public bool IsRegistered => ServiceLocator.HasRegistered<T>();
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Loading

0 comments on commit bb6fa8c

Please sign in to comment.