Пример #1
0
    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);
                    }
                }
            }
        }
    }
Пример #2
0
 void Awake()
 {
     anim              = GetComponent <Animation> ();
     actions           = GetComponent <CharacterActionsManager>();
     chatLine          = GetComponent <CharacterChatLine> ();
     customizer        = GetComponent <CharacterCustomizer> ();
     characterSelector = GetComponent <CharacterSelector>();
 }
Пример #3
0
 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>();
 }
Пример #4
0
    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);
        }
    }
Пример #5
0
    // 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);
        }
    }
Пример #6
0
    //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;
        }
    }
Пример #7
0
 // Use this for initialization
 void Start()
 {
     CC = this;
 }
Пример #8
0
 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();
 }