public void ChangeFirst( T1 newInstance, ref DualLink <T1, T2> var1, ref DualLink <T1, T2> var2 ) { this.type1 = newInstance; var1 = this; var2 = this; }
public void ChangeSecond( T2 newInstance, ref DualLink <T1, T2> var1, ref DualLink <T1, T2> var2 ) { this.type2 = newInstance; var1 = this; var2 = this; }
public void Destroy( ref DualLink <T1, T2> var1, ref DualLink <T1, T2> var2 ) { var1 = null; var2 = null; if (OnDestroy != null) { OnDestroy(); } }
public DualLink( T1 instance1, T2 instance2, ref DualLink <T1, T2> var1, ref DualLink <T1, T2> var2 ) { this.type1 = instance1; this.type2 = instance2; var1 = this; var2 = this; if (typeof(T1) == typeof(T2)) { throw new Exception("Both types cannot be equal, use MonoLink instead."); } }