void UseTwoThings() { var twoThings = new TwoThings<int, double>(); twoThings.AssignThings(3, 30.0); var differetThings = new TwoThings<GenericZombie, float>(); differetThings.AssignThings(new GenericZombie("Stubbs"), 1.0f); }
void Start() { zombie firstZombie = new zombie("stubbs"); zombie secondZombie = new zombie("jackson"); zombie thirdZombie = new zombie("bob"); var SomeThings = new ThreeThings <zombie>(firstZombie, secondZombie, thirdZombie); Debug.Log(SomeThings); var whatAmI = 1; Debug.Log(whatAmI.GetType()); var mixedThings = new TwoThings <zombie, float>(); mixedThings.AssignThings(firstZombie, 1.0f); LogTwoThings(mixedThings.GetFirstThing(), mixedThings.GetSecondThing()); var t = GetComponent <Transform>(); if (t is Transform) { t.localPosition = new Vector3(1, 0, 0); } }
void Start() { zombie firstZombie = new zombie("stubbs"); zombie secondZombie = new zombie("jackson"); zombie thirdZombie = new zombie("bob"); // var keyword is very open keyword - It tells the computer to expect any data type and it means to implicitly get a type once it's been assigned. // Only after the actual object is crated and assigned to the identifier that was created with var will the identifier turn into a type. var SomeThings = new ThreeThings <zombie>(firstZombie, secondZombie, thirdZombie); Debug.Log(SomeThings); var whatAmI = 1; Debug.Log(whatAmI.GetType()); var mixedThings = new TwoThings <zombie, float>(); mixedThings.AssignThings(firstZombie, 1.0f); LogTwoThings(mixedThings.GetFirstThing(), mixedThings.GetSecondThing()); var t = GetComponent <Transform>(); if (t is Transform) { t.localPosition = new Vector3(1, 0, 0); } }