public void Construct(Tetrino.Type type, char[] letters, Thaum.Type[] thaums) { switch (type) { case Tetrino.Type.T1: _tetrino = new Tetrino1(letters, thaums, this.transform); break; case Tetrino.Type.T2: _tetrino = new Tetrino2(letters, thaums, this.transform); break; case Tetrino.Type.T3: _tetrino = new Tetrino3(letters, thaums, this.transform); break; case Tetrino.Type.T4: _tetrino = new Tetrino4(letters, thaums, this.transform); break; case Tetrino.Type.T5: _tetrino = new Tetrino5(letters, thaums, this.transform); break; default: Debug.LogError("Use tetrino types 1-5."); break; } }
// ~~~~~~~~~~~~~~~~~~~~~~~~ All the rotation ~~~~~~~~~~~~~~~~~~~~~~~~ protected void Awake() { _tetrino = GetComponent <Tetrino>(); _pool = FindObjectOfType <Pool <TetrinoDraggable> >(); if (_pool == null) { Debug.LogError("Tetrino " + this.name + " started off not in a pool."); } }