public override void setLoadData(object obj) { if (control == null) { control = GetComponent <GlobalPlayerControl>(); } data = (GlobalControlData)obj; control.characterEnabledList = data.enabledPlayers; control.selected = data.currentPlayer; Debug.Log("data.enabledPlayers:" + data.enabledPlayers); Debug.Log("data.currentPlayer:" + data.currentPlayer); control.SelectCharacter(control.selected); }
// Start is called before the first frame update void Awake() { control = GetComponent <GlobalPlayerControl>(); data = new GlobalControlData(); //get/set }