using Monad; using UnityEngine; public class TestBehaviour : MonoBehaviour { // Start is called before the first frame update void Start() { var bindResult = ServiceLocator.Bind(new TestService()) .Try(); if (bindResult.IsFaulted) { Debug.Log("-->Error: " + bindResult.Exception.Message); } else { var testService = bindResult.Value; testService.Run(); } } }