public override void OnInspectorGUI() { DrawDefaultInspector(); CharacterCustomizer script = (CharacterCustomizer)target; //BUTTON: add clothing if (GUILayout.Button("ADD")) { if (script.ClothesToADD != null) { script.AddClothes(script.ClothesToADD); } } //BUTTONS: remove clothing for (int i = 0; i < script.parts.Length; i++) { if (script.parts[i] != null) { if (script.parts[i].GetComponent <SkinPart>().currentClothes != null && script.parts[i].GetComponent <SkinPart>().currentClothes != script.parts[i].GetComponent <SkinPart>().defaultClothes) { if (GUILayout.Button("X " + script.parts[i].name)) { script.RemoveClothes(i); } } } } }
void Awake() { anim = GetComponent <Animation> (); actions = GetComponent <CharacterActionsManager>(); chatLine = GetComponent <CharacterChatLine> (); customizer = GetComponent <CharacterCustomizer> (); characterSelector = GetComponent <CharacterSelector>(); }
private void Awake() { m_LocalNetworkTogglables = GetComponent <LocalNetworkTogglables>(); m_PlayerNetworkHandler = GetComponent <PlayerNetworkHandler>(); m_RevealActor = GetComponent <RevealActor>(); m_StealthActor = GetComponent <StealthActor>(); m_SkillHandler = GetComponent <SkillHandler>(); m_HealthHandler = GetComponent <HealthHandler>(); m_CharacterCustomizer = GetComponentInChildren <CharacterCustomizer>(); }
private void Awake() { if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } }
// Use this for initialization void Start() { animator = GetComponentInChildren <Animator>(); animator.SetBool("Idling", true); GetComponent <PlayerController>().enabled = isLocalPlayer; this.transform.Find("Tops").GetComponent <Renderer>().material.mainTexture = CharacterCustomizer.GetTop(textureId, this.name); if (isLocalPlayer) { CameraFollow360.player = this.gameObject.transform; CharacterCustomizer.character = this.gameObject; CmdChangeTexture(CharacterCustomizer.CurrentTextureId); } }
//Function called from OnEnable to set a CharacterCustomizer to display a character's info private void SetCharacterCustomizerInfo(CharacterCustomizer customizer_, Character charInfo_) { //Setting the first and last names customizer_.firstNameText.text = charInfo_.firstName; customizer_.lastNameText.text = charInfo_.lastName; //Setting the sex customizer_.sex = charInfo_.sex; //Setting the sex text switch (customizer_.sex) { case Genders.Male: customizer_.sexText.text = "Male"; break; case Genders.Female: customizer_.sexText.text = "Female"; break; case Genders.Genderless: customizer_.sexText.text = "Genderless"; break; } }
// Use this for initialization void Start() { CC = this; }
private void changeTexture(int id) { textureId = id; this.transform.Find("Tops").GetComponent <Renderer>().material.mainTexture = CharacterCustomizer.GetTop(id, this.name); }
private void Awake() { cc = GameObject.FindGameObjectWithTag("Customization").GetComponent <CharacterCustomizer>(); GetClothesMats(); SetCustomizations(); }