Login

Fancade Wiki

Updated Fancade Web.md (markdown)

... ...
@@ -154,31 +154,31 @@ Editor scripts are written in Javascript (ECMAScript E5/E5.1), and here are some
154 154
155 155
```
156 156
// Find prefab by name
157
// var prefabIndex = findPrefab('MyPrefab'); // Returns 0 if not found
157
var prefabIndex = findPrefab('MyPrefab'); // Returns 0 if not found
158 158
159 159
// Set block at position (x, y, z) in level or open block
160
// setBlock(x, y, z, prefabIndex); // prefabIndex == 0 means empty
160
setBlock(x, y, z, prefabIndex); // prefabIndex == 0 means empty
161 161
162 162
// Get block at position (x, y, z) in level or open block
163
// var prefabIndex = getBlock(x, y, z);
163
var prefabIndex = getBlock(x, y, z);
164 164
165 165
// Update changes after using setBlock()
166
// updateChanges(); // Time-consuming, don't do this after each call to setBlock()
166
updateChanges(); // Time-consuming, don't do this after each call to setBlock()
167 167
168 168
// Log printout (only for strings and numbers for now)
169
// log("Found a prefab " + prefabIndex);
169
log("Found a prefab " + prefabIndex);
170 170
171 171
// Get size of level or open block
172
// var size = getSize(); // Returns an array [x, y, z]
172
var size = getSize(); // Returns an array [x, y, z]
173 173
174 174
// Get number of levels
175
// var count = getLevelCount();
175
var count = getLevelCount();
176 176
177 177
// Get current level index
178
// var levelIndex = getLevel();
178
var levelIndex = getLevel();
179 179
180 180
// Change level
181
// setLevel((levelIndex + 1) % count);
181
setLevel((levelIndex + 1) % count);
182 182
183 183
```
184 184
Fancade Wiki