void Start() { if (name.Contains("Hair")) { thisType = ButtonController.ObjectType.Hair; } if (name.Contains("Eye")) { thisType = ButtonController.ObjectType.Eye; } if (name.Contains("Mouth")) { thisType = ButtonController.ObjectType.Mouth; } if (name.Contains("Face")) { thisType = ButtonController.ObjectType.Face; } if (name.Contains("Top")) { thisType = ButtonController.ObjectType.Top; } if (name.Contains("Slider")) { thisType = ButtonController.ObjectType.Value; } cMenuManager = FindObjectOfType <CustomizationMenuManager>(); buttonHolder = holderObject.transform.FindChild("ButtonHolder").gameObject; }
public void OnPressed() { CustomizationMenuManager cMenuManager = FindObjectOfType <CustomizationMenuManager>(); for (int i = 0; i < cMenuManager.placementPostions.Count; i++) { switch (thisType) { case ObjectType.Hair: if (cMenuManager.placementPostions[i].name.Contains("Hair")) { toSpawnPosition = cMenuManager.placementPostions[i]; cMenuManager.currentHair = CreateRelated(cMenuManager.currentHair, toSpawnPosition); } break; case ObjectType.Eye: if (cMenuManager.placementPostions[i].name.Contains("Eye")) { toSpawnPosition = cMenuManager.placementPostions[i]; cMenuManager.currentEye = CreateRelated(cMenuManager.currentEye, toSpawnPosition); } break; case ObjectType.Mouth: if (cMenuManager.placementPostions[i].name.Contains("Mouth")) { toSpawnPosition = cMenuManager.placementPostions[i]; cMenuManager.currentMouth = CreateRelated(cMenuManager.currentMouth, toSpawnPosition); } break; case ObjectType.Face: if (cMenuManager.placementPostions[i].name.Contains("Face")) { toSpawnPosition = cMenuManager.placementPostions[i]; cMenuManager.currentFace = CreateRelated(cMenuManager.currentFace, toSpawnPosition); } break; case ObjectType.Top: if (cMenuManager.placementPostions[i].name.Contains("Top")) { toSpawnPosition = cMenuManager.placementPostions[i]; cMenuManager.currentTop = CreateRelated(cMenuManager.currentTop, toSpawnPosition); } break; case ObjectType.Value: break; default: Debug.Log("You've f****d something up."); break; } } }
void Start() { customizationMenuManager = FindObjectOfType <CustomizationMenuManager>(); playerGameObject = GameObject.FindGameObjectWithTag("Player"); player = ReInput.players.GetPlayer(0); }