-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSceneLayoutScriptable.cs
61 lines (55 loc) · 1.82 KB
/
SceneLayoutScriptable.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Dynamic;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using VNENGINE;
using System.Linq;
namespace PointClick
{
[System.Serializable]
public struct HotSpot
{
public string name, destination;
public float xmin, ymin, xsize, ysize;
}
[System.Serializable]
public struct _Item
{
public string name;
public float x, y;
}
[CreateAssetMenu(fileName = "Data", menuName = "ScriptableObjects/Place", order = 1)]
public class SceneLayoutScriptable : ScriptableObject
{
public string name = string.Empty;
public string description = string.Empty;
public string label = string.Empty;
public Texture image;
bool hasBack = false, hasLeft = false, hasRight = false, hasForward = false;
public List<HotSpot> hotSpots;
public List<_Item> items;
public SceneLayoutScriptable(string name, Texture image, string description = "", List<string> places = null, float[][] hotSpots = null)
{
this.name = name;
this.description = description;
this.image = image;
this.hasBack = false;
this.hasLeft = false;
this.hasRight = false;
this.hasForward = false;
if (places != null && hotSpots != null)
{
if (places.Count != hotSpots.Length)
throw new System.ArgumentException($"Error! places list length '{places.Count}' != hotspots array length '{hotSpots.Length}'");
}
for (var i = 0;i < places.Count; i++)
{
var place = places[i];
var hotspot = hotSpots[i];
//this.hotSpots.Add(place, hotspot);
}
}
}
}