55using System . Collections . Generic ;
66using System . IO ;
77using UnityEditor ;
8- using Improbable . Math ;
98using Random = UnityEngine . Random ;
109using UnityEngine ;
1110
12- namespace Assets . Editor
11+ namespace Assets . Editor
1312{
1413 public class SnapshotMenu : MonoBehaviour
1514 {
1615 [ MenuItem ( "Improbable/Snapshots/Generate Default Snapshot" ) ]
1716 private static void GenerateDefaultSnapshot ( )
1817 {
19- var snapshotEntities = new Dictionary < EntityId , SnapshotEntity > ( ) ;
18+ var snapshotEntities = new Dictionary < EntityId , Entity > ( ) ;
2019 var currentEntityId = 1 ;
2120
2221 snapshotEntities . Add ( new EntityId ( currentEntityId ++ ) , EntityTemplateFactory . CreatePlayerCreatorTemplate ( ) ) ;
@@ -28,7 +27,7 @@ private static void GenerateDefaultSnapshot()
2827 }
2928
3029 // Create and island entity for each island prefab at its given world coordinates
31- public static void PopulateSnapshotWithIslandTerrainEntities ( ref Dictionary < EntityId , SnapshotEntity > snapshotEntities , ref int nextAvailableId )
30+ public static void PopulateSnapshotWithIslandTerrainEntities ( ref Dictionary < EntityId , Entity > snapshotEntities , ref int nextAvailableId )
3231 {
3332 foreach ( var item in SimulationSettings . IslandsEntityPlacements )
3433 {
@@ -38,30 +37,30 @@ public static void PopulateSnapshotWithIslandTerrainEntities(ref Dictionary<Enti
3837 }
3938
4039 // Create shoal of small fish entities around given coordinates
41- public static void PopulateSnapshotWithSmallFishGroups ( ref Dictionary < EntityId , SnapshotEntity > snapshotEntities , ref int nextAvailableId )
40+ public static void PopulateSnapshotWithSmallFishGroups ( ref Dictionary < EntityId , Entity > snapshotEntities , ref int nextAvailableId )
4241 {
4342 foreach ( var location in SimulationSettings . FishShoalStartingLocations )
4443 {
4544 for ( var i = 0 ; i < SimulationSettings . TotalFishInShoal ; i ++ )
4645 {
47- var nextFishCoodinates = new Coordinates ( location . X + Random . Range ( - SimulationSettings . ShoalRadius , SimulationSettings . ShoalRadius ) ,
48- location . Y + Random . Range ( SimulationSettings . ShoalMinDepth , SimulationSettings . ShoalMaxDepth ) ,
49- location . Z + Random . Range ( - SimulationSettings . ShoalRadius , SimulationSettings . ShoalRadius ) ) ;
46+ var nextFishCoodinates = new Vector3 ( location . x + Random . Range ( - SimulationSettings . ShoalRadius , SimulationSettings . ShoalRadius ) ,
47+ location . y + Random . Range ( SimulationSettings . ShoalMinDepth , SimulationSettings . ShoalMaxDepth ) ,
48+ location . z + Random . Range ( - SimulationSettings . ShoalRadius , SimulationSettings . ShoalRadius ) ) ;
5049 snapshotEntities . Add ( new EntityId ( nextAvailableId ++ ) , EntityTemplateFactory . GenerateSmallFishTemplate ( nextFishCoodinates ) ) ;
5150 }
5251 }
5352 }
5453
5554 // Create large fish entities
56- public static void PopulateSnapshotWithLargeFish ( ref Dictionary < EntityId , SnapshotEntity > snapshotEntities , ref int nextAvailableId )
55+ public static void PopulateSnapshotWithLargeFish ( ref Dictionary < EntityId , Entity > snapshotEntities , ref int nextAvailableId )
5756 {
5857 foreach ( var location in SimulationSettings . LargeFishStartingLocations )
5958 {
6059 snapshotEntities . Add ( new EntityId ( nextAvailableId ++ ) , EntityTemplateFactory . GenerateLargeFishTemplate ( location ) ) ;
6160 }
6261 }
6362
64- private static void SaveSnapshot ( IDictionary < EntityId , SnapshotEntity > snapshotEntities )
63+ private static void SaveSnapshot ( IDictionary < EntityId , Entity > snapshotEntities )
6564 {
6665 var snapshotPath = Application . dataPath + SimulationSettings . DefaultRelativeSnapshotPath ;
6766 File . Delete ( snapshotPath ) ;
0 commit comments