Showing the changes to tutorial/tutorial.js (1 of 1 file). Show all
Unified · Split
| @@ -937,6 +937,10 @@ stepCleanupFinish.prototype = { · 936 unmodified lines | ||
| 937 | 937 | |
| 938 | 938 | |
| 939 | 939 | |
| 940 | +function isEntityInLocalTree(entityID) { | |
| 941 | + return Entities.getEntityProperties(entityID, 'visible').visible !== undefined; | |
| 942 | +} | |
| 943 | + | |
| 940 | 944 | function showEntitiesWithTag(tag) { |
| 941 | 945 | var entities = TUTORIAL_TAG_TO_ENTITY_IDS_MAP[tag]; |
| 942 | 946 | if (entities) { |
| @@ -955,6 +959,7 @@ function showEntitiesWithTag(tag) { · 12 unmodified lines | ||
| 955 | 959 | collisionless: collisionless, |
| 956 | 960 | userData: JSON.stringify(data), |
| 957 | 961 | }; |
| 962 | + debug("Showing: ", entityID, ", Is in local tree: ", isEntityInLocalTree(entityID)); | |
| 958 | 963 | Entities.editEntity(entityID, newProperties); |
| 959 | 964 | } |
| 960 | 965 | } |
| @@ -979,6 +984,7 @@ function showEntitiesWithTag(tag) { · 18 unmodified lines | ||
| 979 | 984 | Entities.editEntity(entityID, newProperties); |
| 980 | 985 | }); |
| 981 | 986 | } |
| 987 | + | |
| 982 | 988 | function hideEntitiesWithTag(tag) { |
| 983 | 989 | var entities = TUTORIAL_TAG_TO_ENTITY_IDS_MAP[tag]; |
| 984 | 990 | if (entities) { |
| @@ -994,6 +1000,8 @@ function hideEntitiesWithTag(tag) { · 9 unmodified lines | ||
| 994 | 1000 | ignoreForCollisions: 1, |
| 995 | 1001 | userData: JSON.stringify(data), |
| 996 | 1002 | }; |
| 1003 | + | |
| 1004 | + debug("Hiding: ", entityID, ", Is in local tree: ", isEntityInLocalTree(entityID)); | |
| 997 | 1005 | Entities.editEntity(entityID, newProperties); |
| 998 | 1006 | } |
| 999 | 1007 | } |
| @@ -1020,7 +1028,9 @@ function hideEntitiesWithTag(tag) { · 20 unmodified lines | ||
| 1020 | 1028 | // cached list of entities. Otherwise, return undefined. |
| 1021 | 1029 | function getEntityWithName(name) { |
| 1022 | 1030 | debug("Getting entity with name:", name); |
| 1023 | − return TUTORIAL_NAME_TO_ENTITY_PROPERTIES_MAP[name]; | |
| 1031 | + var entityID = TUTORIAL_NAME_TO_ENTITY_PROPERTIES_MAP[name]; | |
| 1032 | + debug("Entity id: ", entityID, ", Is in local tree: ", isEntityInLocalTree(entityID)); | |
| 1033 | + return entityID; | |
| 1024 | 1034 | } |
| 1025 | 1035 | |
| 1026 | 1036 | |