Unity c# using dictionnary variables into a GUI Text

Hello, since recently I’ve tried to make a GUI script that would display some skills defined in another script (The link between both is working.) but the problem I’m facing now is that a line ( skilltitle = playerskills.skills*; ) won’t work.*
Otherwise, if you wish to help (which I’m grateful of ^^, Thanks for all future help ^^) here’s the errors I get:
[86734-unity-error.png_|86734]*
and here’s the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]
public class PlayerSkillsButtons : MonoBehaviour {

  • public bool debugMode = false;*

  • public GUISkin skin = null;*

  • static int sizex = 60;*

  • static int sizey = 31;*

  • static int panelsizex = 196;*

  • static int panelsizey = 318;*

  • static int buttonsizex = 60;*

  • static int buttonsizey = 27;*

  • private int clicked = 0;*

  • private int i;*

  • private int j = 30;*

  • Rect position = new Rect(Screen.width - sizex, Screen.height - sizey, sizex, sizey);*

  • Rect panelposition = new Rect (Screen.width - panelsizex, Screen.height - panelsizey - 31, panelsizex, panelsizey);*

  • Rect buttonposition = new Rect(Screen.width - panelsizex + 6, Screen.height - panelsizey + 4, buttonsizex, buttonsizey);*

  • Rect textposition = new Rect(buttonposition.x, buttonposition.y, 20, 15);*

  • GameObject player;*

  • PlayerSkills playerskills;*

  • public string title = “Skills”;*

  • public Texture skillPanelButton;*

  • public Texture skillbutton;*

  • string emptytitle = string.Empty;*

  • string skilltitle = string.Empty;*

  • void Start() {*

  •  player = GameObject.Find("Player");*
    
  •  if (player.GetComponent<PlayerSkills>())*
    
  •  {*
    
  •  	playerskills = player.GetComponent<PlayerSkills>().skills;*
    
  •  }*
    

_ skilltitle = playerskills.skills*;*_

* }*

* void OnGUI() {*
* GUI.skin = skin;*

* if (debugMode || Application.isPlaying)*
* {*
* if (!GUI.enabled)*
* {*
* GUI.enabled = true;*
* }*
* if (GUI.Button(position, title))*
* {*
* if (clicked == 0)*
* {*
* clicked = 1;*
* }*
* else*
* {*
* clicked = 0;*
* }*
* }*

* if (clicked == 1){*
* GUI.DrawTexture(panelposition, skillPanelButton);*

* while ( i > -1 && i < 27) {*
* if (i == 10)*
* {*
* j = 60;*
* }*
* else if (i == 19)*
* {*
* j = 120;*
* }*
_ buttonposition = new Rect(Screen.width - panelsizex + 6 + j, Screen.height - panelsizey + 4 + (i * 27), buttonsizex, buttonsizey);_
* GUI.Button(buttonposition, emptytitle);*
* GUI.TextField(textposition, (string)skilltitle);*
* i++;*

* }*
* }*
* else*
* {*
* GUI.enabled = false;*
* }*
* }*
* }*
}

_*

So, PlayerSkills playerskills; is of type PlayerSkills.
then it is assigned the skills property of the PlayerSkills component found

playerskills = player.GetComponent<PlayerSkills>().skills;

Is the skills property of type PlayerSkills too ? Otherwise you just want to call

playerskills = player.GetComponent<PlayerSkills>();

And if the skills property is a Dictionnary<int, string>, the following will work

skilltitle = playerskills.skills*;*