Beispiel #1
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
    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
 }