I made this code to try to get my character customization form my silly little multiplayer game, but this does not activate the hat if the other client has their hat set to on. ignore the monical and parrot.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class CosAct : MonoBehaviour {
public PhotonView photonView;
public int hatTrue = 0;
//public int monicalTrue = 0;
//public int parrotTrue = 0;
void Update(){
photonView = this.transform.GetComponent<PhotonView> ();
hatTrue = PlayerPrefs.GetInt ("Hat");
//monicalTrue = PlayerPrefs.GetInt("Monical");
//parrotTrue = PlayerPrefs.GetInt("Parrot");
if(hatTrue == 1){
Debug.Log ("set hat on");
ActHat();
}else{
return;
}
//if(monicalTrue == 0){
// ActMonical();
// }else{
// return;
// }
//if(parrotTrue == 0){
// ActParrot();
// }else{
// return;
// }
}
void localhatlayer(){
if(photonView.isMine){
this.transform.FindChild ("Hat").FindChild("botcy").gameObject.layer = 11;
this.transform.FindChild ("Hat").FindChild("topcy").gameObject.layer = 11;
}
}
[PunRPC]
void ActHat(){
transform.FindChild("Hat").gameObject.SetActive(true);
localhatlayer ();
}
void ActMonical(){
transform.FindChild("Monical").gameObject.SetActive(true);
}
void ActParrot(){
transform.FindChild("Parrot").gameObject.SetActive(true);
}
}