In this script that i use to hold values for later use i made a struct. When i try to edit it using a setter method it goes through the lines of code without any errors, says in debug mode that it changed in the setter method but nothing has really changed. I’ve tried for the last 6 hours to find a solution through googling and trial and error but im afraid im all out of ideas and options by now. The code as it is right now isn’t changing anything that is part of choice1, choice2 or choice3. Below is my code, I can provide further details if necessary, any help at all is greatly apreciated.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EventCardAttributes : MonoBehaviour
{
[Header("General Stuff i guess")]
[SerializeField] public string cardName;
[SerializeField] public Sprite cardFront;
[SerializeField] public int quantity;
[Header("Choice 1 Options")]
[SerializeField] string title1;
[SerializeField] int reqSuspicion1;
[SerializeField] bool playerShouldHaveMoreThanReqSus1;
[SerializeField] int reqHingabe1;
[SerializeField] bool playerShouldHaveMoreThanReqHin1;
[SerializeField] int reqBekanntheit1;
[SerializeField] bool playerShouldHaveMoreThanReqBek1;
[SerializeField] string[] reqRessources1;
[SerializeField] bool costIsVariable1;
[SerializeField] float percentOfInvThatShouldBeCost1;
[SerializeField] string[] getRessources1;
[SerializeField] int getSuspicion1;
[SerializeField] int getHingabe1;
[SerializeField] int getBekanntheit1;
[SerializeField] string cardToInsertText1;
[SerializeField] List<GameObject> cardToInsertPrefab1 = new List<GameObject>();
[SerializeField] int cardToInsertAmount1;
[Space(order =0)]
[Header("Choice 2 Options",order =1)]
[SerializeField] string title2;
[SerializeField] int reqSuspicion2;
[SerializeField] bool playerShouldHaveMoreThanReqSus2;
[SerializeField] int reqHingabe2;
[SerializeField] bool playerShouldHaveMoreThanReqHin2;
[SerializeField] int reqBekanntheit2;
[SerializeField] bool playerShouldHaveMoreThanReqBek2;
[SerializeField] string[] reqRessources2;
[SerializeField] bool costIsVariable2;
[SerializeField] float percentOfInvThatShouldBeCost2;
[SerializeField] string[] getRessources2;
[SerializeField] int getSuspicion2;
[SerializeField] int getHingabe2;
[SerializeField] int getBekanntheit2;
[SerializeField] string cardToInsertText2;
[SerializeField] List<GameObject> cardToInsertPrefab2 = new List<GameObject>();
[SerializeField] int cardToInsertAmount2;
[Space(order = 0)]
[Header("Choice 3 Options", order = 1)]
[SerializeField] string title3;
[SerializeField] int reqSuspicion3;
[SerializeField] bool playerShouldHaveMoreThanReqSus3;
[SerializeField] int reqHingabe3;
[SerializeField] bool playerShouldHaveMoreThanReqHin3;
[SerializeField] int reqBekanntheit3;
[SerializeField] bool playerShouldHaveMoreThanReqBek3;
[SerializeField] string[] reqRessources3;
[SerializeField] bool costIsVariable3;
[SerializeField] float percentOfInvThatShouldBeCost3;
[SerializeField] string[] getRessources3;
[SerializeField] int getSuspicion3;
[SerializeField] int getHingabe3;
[SerializeField] int getBekanntheit3;
[SerializeField] string cardToInsertText3;
[SerializeField] List<GameObject> cardToInsertPrefab3 = new List<GameObject>();
[SerializeField] int cardToInsertAmount3;
public choice choice1 = new choice();
public choice choice2 = new choice();
public choice choice3 = new choice();
public struct choice
{
public string title;
public int reqSuspicion;
public bool playerShouldHaveMoreThanReqSus;
public int reqHingabe;
public bool playerShouldHaveMoreThanReqHin;
public int reqBekanntheit;
public bool playerShouldHaveMoreThanReqBek;
public string[] reqRessources;
public bool costIsVariable;
public float percentOfInvThatShouldBeCost;
public string[] getRessources;
public int getSuspicion;
public int getHingabe;
public int getBekanntheit;
public string cardToInsertText;
public List<GameObject> cardToInsertPrefab;
public int cardToInsertAmount;
public choice(string title, int reqSuspicion, bool reqSusShouldBeGreaterThan, int reqHingabe, bool reqHinShouldBeGreaterThan, int reqBekanntheit, bool reqBekShouldBeGreaterThan, string[] reqRessources, bool costIsVariable, float percentOfInvThatShouldBeCost, string[] getRessources, int getSuspicion, int getHingabe, int getBekanntheit, string cardToInsertText, List<GameObject> cardToInsertPrefab, int cardToInsertAmount)
{
this.title = title;
this.reqSuspicion = reqSuspicion;
this.playerShouldHaveMoreThanReqSus = reqSusShouldBeGreaterThan;
this.reqHingabe = reqHingabe;
this.playerShouldHaveMoreThanReqHin = reqHinShouldBeGreaterThan;
this.reqBekanntheit = reqBekanntheit;
this.playerShouldHaveMoreThanReqBek = reqBekShouldBeGreaterThan;
this.reqRessources = reqRessources;
this.costIsVariable = costIsVariable;
this.percentOfInvThatShouldBeCost = percentOfInvThatShouldBeCost;
this.getRessources = getRessources;
this.getSuspicion = getSuspicion;
this.getHingabe = getHingabe;
this.getBekanntheit = getBekanntheit;
this.cardToInsertText = cardToInsertText;
this.cardToInsertPrefab = cardToInsertPrefab;
this.cardToInsertAmount = cardToInsertAmount;
}
}
public choice Choice1
{
get
{
choice1 = new choice(title1, reqSuspicion1, playerShouldHaveMoreThanReqSus1, reqHingabe1, playerShouldHaveMoreThanReqHin1, reqBekanntheit1, playerShouldHaveMoreThanReqBek1, reqRessources1, costIsVariable1, percentOfInvThatShouldBeCost1, getRessources1, getSuspicion1, getHingabe1, getBekanntheit1, cardToInsertText1, cardToInsertPrefab1, cardToInsertAmount1);
return choice1;
}
set
{
choice1 = value;
choice1.title = value.title;
choice1.reqSuspicion = value.reqSuspicion;
choice1.playerShouldHaveMoreThanReqSus = value.playerShouldHaveMoreThanReqSus;
choice1.reqHingabe = value.reqHingabe;
choice1.playerShouldHaveMoreThanReqHin = value.playerShouldHaveMoreThanReqHin;
choice1.reqBekanntheit = value.reqBekanntheit;
choice1.playerShouldHaveMoreThanReqBek = value.playerShouldHaveMoreThanReqBek;
choice1.reqRessources = value.reqRessources;
choice1.costIsVariable = value.costIsVariable;
choice1.percentOfInvThatShouldBeCost = value.percentOfInvThatShouldBeCost;
choice1.getRessources = value.getRessources;
choice1.getSuspicion = value.getSuspicion;
choice1.getHingabe = value.getHingabe;
choice1.getBekanntheit = value.getBekanntheit;
choice1.cardToInsertText = value.cardToInsertText;
choice1.cardToInsertPrefab = value.cardToInsertPrefab;
choice1.cardToInsertAmount = value.cardToInsertAmount;
}
}
public void SetNewChoice1(EventCardAttributes.choice val)
{
choice1 = val;
}
public choice Choice2
{
get
{
choice2 = new choice(title2, reqSuspicion2, playerShouldHaveMoreThanReqSus2, reqHingabe2, playerShouldHaveMoreThanReqHin2, reqBekanntheit2, playerShouldHaveMoreThanReqBek2, reqRessources2, costIsVariable2, percentOfInvThatShouldBeCost2, getRessources2, getSuspicion2, getHingabe2, getBekanntheit2, cardToInsertText2, cardToInsertPrefab2, cardToInsertAmount2);
return choice2;
}
set
{
choice2 = value;
}
}
public void SetNewChoice2(EventCardAttributes.choice val)
{
choice2 = val;
}
public choice Choice3
{
get
{
choice3 = new choice(title3, reqSuspicion3, playerShouldHaveMoreThanReqSus3, reqHingabe3, playerShouldHaveMoreThanReqHin3, reqBekanntheit3, playerShouldHaveMoreThanReqBek3, reqRessources3, costIsVariable3, percentOfInvThatShouldBeCost3, getRessources3, getSuspicion3, getHingabe3, getBekanntheit3, cardToInsertText3, cardToInsertPrefab3, cardToInsertAmount3);
return choice3;
}
set
{
choice3 = value;
}
}
public void SetNewChoice3(EventCardAttributes.choice val)
{
choice3 = val;
}
}