Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could i get assets with inheritance? #82

Open
Victoctoc opened this issue Aug 5, 2020 · 1 comment
Open

Could i get assets with inheritance? #82

Victoctoc opened this issue Aug 5, 2020 · 1 comment

Comments

@Victoctoc
Copy link

Hi to all! i'm trying to generate a base class andafter excel data will be a child class, I created dataitem class

I configurated my Excel with this fields, and some fields are repited and i want to make a base class
image
image

Like this:

@Victoctoc
Copy link
Author

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// [System.Serializable]
public class DataItem
{

[SerializeField]
string id;
public string Id { get {return id; } set { this.id = value;} }

[SerializeField]
string nameitem;
public string Nameitem { get {return nameitem; } set { this.nameitem = value;} }

[SerializeField]
string spritename;
public string Spritename { get {return spritename; } set { this.spritename = value;} }

[SerializeField]
string description;
public string Description { get {return description; } set { this.description = value;} }

[SerializeField]
float price;
public float Price { get {return price; } set { this.price = value;} }

[SerializeField]
float pprice;
public float Pprice { get {return pprice; } set { this.pprice = value;} }

[SerializeField]
float discount;
public float Discount { get {return discount; } set { this.discount = value;} }

[SerializeField]
string value;
public string Value { get {return value; } set { this.value = value;} }
}
`

I created dataitem class to simplify and use for other methods than I have. and I use inheritance

public class CreditData :DataItem
{

[SerializeField]
TypePrice typeprice;
public TypePrice TYPEPRICE { get {return typeprice; } set { this.typeprice = value;} }
[SerializeField]
string url;
public string Url { get {return url; } set { this.url = value;} }
}

but lose my inherited values and fill the field like this

image

Do you have any idea how to solve this to generate correct data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant