Beispiel #1
0
    private void Awake()
    {
        //needed for inc/dec
        sm = smObj.GetComponent <statManager>();

        //set up all buttons
        incButton.onClick.AddListener(new UnityAction(incStat));
        decButton.onClick.AddListener(new UnityAction(decStat));
        randButton.onClick.AddListener(new UnityAction(sm.randomizeStats));
    }
Beispiel #2
0
    public static void saveCreation(statManager player)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/stats.bin";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        creationData data = new creationData(player);

        formatter.Serialize(stream, data);
        stream.Close();
    }
 public creationData(statManager createStats)
 {
     str         = createStats.str;
     end         = createStats.end;
     intel       = createStats.intel;
     wis         = createStats.wis;
     dex         = createStats.dex;
     totalPoints = createStats.totalPoints;
     strRank     = createStats.strRank;
     endRank     = createStats.endRank;
     intelRank   = createStats.intelRank;
     wisRank     = createStats.wisRank;
     dexRank     = createStats.dexRank;
 }