// Use this for initialization void Start() { //init gameController //LauchCapacity parentFunction = GetComponentInParent<LauchCapacity>(); controllerName = parentFunction.getControllerName(); capacityIntChosen = parentFunction.capacityIntChosen; activated = false; switch (capacityIntChosen) { case CapacityEnum.Glyph: capacityChosen = GetComponentInChildren <GlyphCapacity>(); break; case CapacityEnum.Repulsion: capacityChosen = GetComponentInChildren <RepulseCapacity>(); break; case CapacityEnum.Meteor: capacityChosen = GetComponentInChildren <MeteorCapacity>(); break; case CapacityEnum.Freeze: capacityChosen = GetComponentInChildren <FreezeCapacity>(); break; default: Debug.Log("Default case"); break; } }