Skip to content

Instantly share code, notes, and snippets.

@johans2
Created September 9, 2018 12:05
Show Gist options
  • Save johans2/58f595d9a56f8269984440c02c418882 to your computer and use it in GitHub Desktop.
Save johans2/58f595d9a56f8269984440c02c418882 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEngine.Assertions;
using Cakewalk.IoC;
public class ExampleBehaviour : MonoBehaviour {
[Dependency] IExampleClass exampleClass;
[Dependency] ExampleClass2 exampleClass2;
void Awake() {
this.InjectDependencies();
}
void Start() {
Assert.IsNotNull(exampleClass);
Assert.IsNotNull((exampleClass as ExampleClass).testClass2);
Assert.IsNotNull(exampleClass2);
}
void Update() {
// Do stuff..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment