private void Awake() { sides = new List <Side>(); if (thisPlatformType != WorldSubManager.PlatformTypes.Test) { thisPlatformType = WorldSubManager.PlatformTypes.Normal; thisPlatformDifficulty = DifficultySubManager.instance.GetPlatformDifficulty(this); thisPlatformSpinSpeed = DifficultySubManager.instance.GetPlatformSpinSpeed(thisPlatformDifficulty); } try { //If we forget to setup the prefabs, since it will be #ofplats * 4 if (sides.Count <= 0) { //finds sides and sets them in the sides[] for (int i = 0; i < 4; i++) { //naming starts at S_01--> S_04 sides.Add(transform.Find(string.Format("S_0{0}", (i + 1).ToString())).GetComponent <Side>()); } //sets the side colors for (int i = 0; i < sides.Count; i++) { if (i % 2 == 0) { //true, green sides[i].gameObject.GetComponent <Renderer>().material = WorldSubManager.instance.plat_Y; sides[i].isPassable = true; if (sides[i].col.enabled) { sides[i].col.isTrigger = true; } } else if (i % 2 != 0) { //false, red sides[i].gameObject.GetComponent <Renderer>().material = WorldSubManager.instance.plat_N; sides[i].isPassable = false; if (sides[i].col.enabled) { sides[i].col.isTrigger = false; } } } } } catch (Exception ex) { Debug.Log("Platform.Awake(): " + ex.Message); } }
void EstablishType(WorldSubManager.PlatformTypes type) { switch (type) { case WorldSubManager.PlatformTypes.Normal: break; case WorldSubManager.PlatformTypes.Blinker: break; case WorldSubManager.PlatformTypes.Dud: break; case WorldSubManager.PlatformTypes.Rich: break; case WorldSubManager.PlatformTypes.Special: break; case WorldSubManager.PlatformTypes.Tri: break; case WorldSubManager.PlatformTypes.Warp: break; case WorldSubManager.PlatformTypes.Test: EstablishType(WorldSubManager.PlatformTypes.Test); break; default: EstablishType(WorldSubManager.PlatformTypes.Normal); break; } }