Skip to content

Map JSON format #3

@mmmdule

Description

@mmmdule

Make each map a JSON file upon saving.

The file should have a list of objects. The GameComponent class should look something like this:

    string type; //most important, determines prefab to be spawned
    int health;
    int projectileDamage;
    float firingRate; //pause between shots
    float patrolRange;
    float sightRange;
    float chaseRange;
    bool canMove;
    int x; //X coordinate (column in table)
    int y; //Y coordinate (row in table)
    ...

The "type" attribute of the object will be checked when going through the deserialized list. Based on that, the proper GameObject Prefabs will be spawned with the written attribute values.

The GameComponent class will be used in both the C# App (for creating a list of it) and the Unity Game (for reading the list of it from the JSON file).

If there is no GameComponent in the table cell currently checked, no GameComponent will be added to the List when writing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions