// Start is called before the first frame update void Start() { if (PlayerTShirt1 != null) { PlayerTShirt1.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.tshirtColor); PlayerTShirt2.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.tshirtColor); PlayerTShirt3.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.tshirtColor); PlayerPants1.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.pantsColor); PlayerPants2.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.pantsColor); PlayerShoes1.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.shoesColor); PlayerShoes2.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.shoesColor); } joystick = FindObjectOfType <Joystick>(); joybuttonA = FindObjectOfType <ActionButtonScript>(); //joybuttonS = FindObjectOfType<SpecialButtonScript>(); transform.position = spawnAera.position; player = GameObject.FindGameObjectWithTag("Player"); joystickH = joystick.Horizontal; joystickV = joystick.Vertical; Anim = GetComponent <Animator>(); r = GetComponent <Rigidbody>(); }
// COLORS BUTTONS public void ColorButton(string color) { if (TShirts) { PlayerTShirt1.GetComponent <Renderer>().material.color = hexToColor(color); PlayerTShirt2.GetComponent <Renderer>().material.color = hexToColor(color); PlayerTShirt3.GetComponent <Renderer>().material.color = hexToColor(color); CharacterColorPref.tshirtColor = color; } if (Pants) { PlayerPants1.GetComponent <Renderer>().material.color = hexToColor(color); PlayerPants2.GetComponent <Renderer>().material.color = hexToColor(color); CharacterColorPref.pantsColor = color; } if (Shoes) { PlayerShoes1.GetComponent <Renderer>().material.color = hexToColor(color); PlayerShoes2.GetComponent <Renderer>().material.color = hexToColor(color); CharacterColorPref.shoesColor = color; } }