Newer
Older
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="UTF-8"?>
<cs:Program xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cs="http://www.example.org/cs.ecore" xsi:schemaLocation="http://www.example.org/cs.ecore ../metamodel/csProgram/CsProgram.ecore">
<files filename="BarDisplayLives">
<namespaces namespace="DSL">
<using>UnityEngine</using>
<using>System</using>
<typedefs xsi:type="cs:Class" identifier="BarDisplayLives" baseType="//@externalTypes.0">
<members identifier="maxValue">
<type xsi:type="cs:PrimitiveType" type="float"/>
</members>
<members identifier="barImage">
<type xsi:type="cs:CompoundType" referencedType="//@externalTypes.4"/>
</members>
<methods identifier="Update" accessability="none">
<body>barImage.fillAmount = DataManager.instance.GetLives()/maxValue;</body>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
</typedefs>
</namespaces>
</files>
<files filename="DataManager">
<namespaces namespace="DSL">
<using>UnityEngine</using>
<using>System</using>
<typedefs xsi:type="cs:Class" identifier="DataManager" baseType="//@externalTypes.0">
<members identifier="instance" specifier="static">
<type xsi:type="cs:CompoundType" referencedType="//@files.1/@namespaces.0/@typedefs.0"/>
</members>
<members identifier="lives">
<type xsi:type="cs:PrimitiveType" type="int"/>
</members>
<methods identifier="Awake" accessability="private">
<body>instance??= this;</body>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="GetLives">
<body>return this.lives;</body>
<returnType xsi:type="cs:PrimitiveType" type="int"/>
</methods>
<methods identifier="SetLives">
<parameters identifier="value">
<type xsi:type="cs:PrimitiveType" type="int"/>
</parameters>
<body>this.lives = value;</body>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
</typedefs>
</namespaces>
</files>
<files filename="HealthPack">
<namespaces namespace="DSL">
<using>UnityEngine</using>
<using>System</using>
<typedefs xsi:type="cs:Class" identifier="HealthPack" baseType="//@externalTypes.0">
<methods identifier="Update" accessability="none">
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="Start" accessability="none">
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="OnTriggerEnter2D">
<parameters identifier="collider">
<type xsi:type="cs:CompoundType" referencedType="//@externalTypes.5"/>
</parameters>
<body>if (collider.gameObject.tag == "Player") {</body>
<body>DataManager.instance.SetLives(DataManager.instance.GetLives()+1);</body>
<body>}</body>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
</typedefs>
</namespaces>
</files>
<files filename="Enemy">
<namespaces namespace="DSL">
<using>UnityEngine</using>
<using>System</using>
<typedefs xsi:type="cs:Class" identifier="Enemy" baseType="//@externalTypes.0">
<methods identifier="Update" accessability="none">
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="Start" accessability="none">
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="OnTriggerEnter2D">
<parameters identifier="collider">
<type xsi:type="cs:CompoundType" referencedType="//@externalTypes.5"/>
</parameters>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
</typedefs>
</namespaces>
</files>
<files filename="Character">
<namespaces namespace="DSL">
<using>UnityEngine</using>
<using>System</using>
<typedefs xsi:type="cs:Class" identifier="Character" baseType="//@externalTypes.0">
<members identifier="speed">
<type xsi:type="cs:PrimitiveType" type="float"/>
</members>
<members identifier="horizontal" accessability="private">
<type xsi:type="cs:PrimitiveType" type="float"/>
</members>
<members identifier="rigidbody">
<type xsi:type="cs:CompoundType" referencedType="//@externalTypes.2"/>
</members>
<members identifier="vertical" accessability="private">
<type xsi:type="cs:PrimitiveType" type="float"/>
</members>
<methods identifier="Update" accessability="none">
<body>horizontal = Input.GetAxisRaw("Horizontal");</body>
<body>vertical = Input.GetAxisRaw("Vertical");</body>
<body>rigidbody.velocity = new Vector2(horizontal * speed, vertical * speed);</body>
<body>if (Input.GetKeyDown(KeyCode.P)) {</body>
<body>rigidbody.AddForce(new Vector2(1,0)*10.0f, ForceMode2D.Impulse);</body>
<body>}</body>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="Start" accessability="none">
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
<methods identifier="OnTriggerEnter2D">
<parameters identifier="collider">
<type xsi:type="cs:CompoundType" referencedType="//@externalTypes.5"/>
</parameters>
<body>if (collider.gameObject.tag == "Enemy") {</body>
<body>DataManager.instance.SetLives(DataManager.instance.GetLives()-1);</body>
<body>}</body>
<returnType xsi:type="cs:PrimitiveType"/>
</methods>
</typedefs>
</namespaces>
</files>
<externalTypes identifier="MonoBehaviour" importedFrom="UnityEngine"/>
<externalTypes identifier="Vector2" importedFrom="UnityEngine" type="struct"/>
<externalTypes identifier="Rigidbody2D" importedFrom="UnityEngine"/>
<externalTypes identifier="Text" importedFrom="UnityEngine.UI"/>
<externalTypes identifier="Image" importedFrom="UnityEngine.UI"/>
<externalTypes identifier="Collider2D" importedFrom="UnityEngine"/>
<externalTypes identifier="Collision2D" importedFrom="UnityEngine"/>
<externalTypes identifier="GameObject" importedFrom="UnityEngine"/>
</cs:Program>