Newer
Older
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerScript : MonoBehaviour
{
public Inventory inventory;
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
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void AddLenghtFact()
{
LengthObject fact = ScriptableObject.CreateInstance<LengthObject>();
fact.PointA = "A";
fact.PointB = "B";
fact.Lenght = 1.0;
fact.Description = "LengthFact";
inventory.AddFact(fact);
}
public void AddDemoScroll(){
DefaultScroll scroll = ScriptableObject.CreateInstance<DefaultScroll>();
scroll.Description = "Dis is Scroll";
inventory.AddScroll(scroll);
}
private void OnApplicationQuit()
{
inventory.Facts.Clear();
}
}