// 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; } }
// Use this for initialization void Start() { controllerName = GetComponentInParent <DontDestroy>().controllerName; int cpt = GetComponentInParent <DontDestroy>().cptCapacity; capacityIntChosen = (CapacityEnum)cpt; Debug.Log(capacityIntChosen); readyToLaunch = true; inCoolDown = false; sombrero = this.transform.Find("Player/rig/spine/chest/neck/head/MexicanHat").GetComponent <MeshRenderer>(); sombrero.material = Resources.Load(capacityIntChosen.ToString(), typeof(Material)) as Material; }
public void SetCapacity(CapacityEnum capacity) { this.capacityIntChosen = capacity; }