Exemplo n.º 1
0
        void Start()
        {
            //Something needs to call DependencyInjection.InjectDependencies.
            //
            //One option is to call it in MonoBehaviour::Start...
            InjectDependencies.On(this);

            GetComponent <Button>().onClick.AddListener(this.OnClick);
        }
Exemplo n.º 2
0
        private void Start()
        {
            //Something needs to call DependencyInjection.InjectDependencies.
            //
            //One option is to call it in MonoBehaviour::Start...
            InjectDependencies.On(this);

            m_text = GetComponent <Text>();

            // since dependency injection is complete, the counter property should be set now
            this.counter.onUpdated.AddListener(this.UpdateDisplay);
            UpdateDisplay();
        }