예제 #1
0
 // Token: 0x06001ED4 RID: 7892 RVA: 0x000A89C0 File Offset: 0x000A6DC0
 private static void select(Transform select)
 {
     if (EditorNodes.selection != null)
     {
         if (EditorNodes.node.type == ENodeType.SAFEZONE)
         {
             EditorNodes.selection.GetComponent <Renderer>().material = (Material)Resources.Load("Materials/Safezone");
         }
         else if (EditorNodes.node.type == ENodeType.PURCHASE)
         {
             EditorNodes.selection.GetComponent <Renderer>().material = (Material)Resources.Load("Materials/Purchase");
         }
         else if (EditorNodes.node.type == ENodeType.ARENA)
         {
             EditorNodes.selection.GetComponent <Renderer>().material = (Material)Resources.Load("Materials/Arena");
         }
         else if (EditorNodes.node.type == ENodeType.DEADZONE)
         {
             EditorNodes.selection.GetComponent <Renderer>().material = (Material)Resources.Load("Materials/Deadzone");
         }
         else if (EditorNodes.node.type == ENodeType.EFFECT)
         {
             EditorNodes.selection.GetComponent <Renderer>().material = (Material)Resources.Load("Materials/Effect");
         }
         else
         {
             EditorNodes.selection.GetComponent <Renderer>().material.color = Color.white;
         }
     }
     if (EditorNodes.selection == select || select == null)
     {
         EditorNodes.selection = null;
         EditorNodes._node     = null;
     }
     else
     {
         EditorNodes.selection = select;
         EditorNodes._node     = LevelNodes.getNode(EditorNodes.selection);
         if (EditorNodes.node.type == ENodeType.SAFEZONE || EditorNodes.node.type == ENodeType.PURCHASE || EditorNodes.node.type == ENodeType.ARENA || EditorNodes.node.type == ENodeType.DEADZONE || EditorNodes.node.type == ENodeType.EFFECT)
         {
             EditorNodes.selection.GetComponent <Renderer>().material = (Material)Resources.Load("Materials/Remove");
         }
         else
         {
             EditorNodes.selection.GetComponent <Renderer>().material.color = Color.red;
         }
     }
     EditorEnvironmentNodesUI.updateSelection(EditorNodes.node);
 }
예제 #2
0
 // Token: 0x06001ED5 RID: 7893 RVA: 0x000A8BD0 File Offset: 0x000A6FD0
 private void Update()
 {
     if (!EditorNodes.isNoding)
     {
         return;
     }
     if (!EditorInteract.isFlying && GUIUtility.hotControl == 0)
     {
         if (EditorInteract.worldHit.transform != null)
         {
             EditorNodes.location.position = EditorInteract.worldHit.point;
             EditorNodes.safezone.position = EditorInteract.worldHit.point;
             EditorNodes.purchase.position = EditorInteract.worldHit.point;
             EditorNodes.arena.position    = EditorInteract.worldHit.point;
             EditorNodes.deadzone.position = EditorInteract.worldHit.point;
             EditorNodes.airdrop.position  = EditorInteract.worldHit.point;
             EditorNodes.effect.position   = EditorInteract.worldHit.point;
         }
         if ((Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace)) && EditorNodes.selection != null)
         {
             LevelNodes.removeNode(EditorNodes.selection);
         }
         if (Input.GetKeyDown(ControlsSettings.tool_2) && EditorInteract.worldHit.transform != null && EditorNodes.selection != null)
         {
             Vector3 point = EditorInteract.worldHit.point;
             EditorNodes.node.move(point);
         }
         if (Input.GetKeyDown(ControlsSettings.primary))
         {
             if (EditorInteract.logicHit.transform != null)
             {
                 if (EditorInteract.logicHit.transform.name == "Node")
                 {
                     EditorNodes.select(EditorInteract.logicHit.transform);
                 }
             }
             else if (EditorInteract.worldHit.transform != null)
             {
                 Vector3 point2 = EditorInteract.worldHit.point;
                 EditorNodes.select(LevelNodes.addNode(point2, EditorNodes.nodeType));
             }
         }
     }
 }
예제 #3
0
		public static void save()
		{
			LevelObjects.save();
			LevelLighting.save();
			LevelGround.save();
			LevelRoads.save();
			if (!Level.isVR)
			{
				LevelNavigation.save();
				LevelNodes.save();
				LevelItems.save();
				LevelPlayers.save();
				LevelZombies.save();
				LevelVehicles.save();
				LevelAnimals.save();
				LevelVisibility.save();
			}
			Editor.save();
		}
예제 #4
0
		public IEnumerator init(int id)
		{
			if (!Level.isVR)
			{
				LevelNavigation.load();
			}
			LoadingUI.updateProgress(1f / Level.STEPS);
			yield return null;
			LevelObjects.load();
			LoadingUI.updateProgress(2f / Level.STEPS);
			yield return null;
			LevelLighting.load(Level.size);
			LoadingUI.updateProgress(3f / Level.STEPS);
			yield return null;
			LevelGround.load(Level.size);
			LoadingUI.updateProgress(4f / Level.STEPS);
			yield return null;
			LevelRoads.load();
			LoadingUI.updateProgress(5f / Level.STEPS);
			yield return null;
			if (!Level.isVR)
			{
				LevelNodes.load();
				LoadingUI.updateProgress(6f / Level.STEPS);
				yield return null;
				LevelItems.load();
				LoadingUI.updateProgress(7f / Level.STEPS);
				yield return null;
			}
			LevelPlayers.load();
			LoadingUI.updateProgress(8f / Level.STEPS);
			yield return null;
			if (!Level.isVR)
			{
				LevelZombies.load();
				LoadingUI.updateProgress(9f / Level.STEPS);
				yield return null;
				LevelVehicles.load();
				LoadingUI.updateProgress(10f / Level.STEPS);
				yield return null;
				LevelAnimals.load();
				LoadingUI.updateProgress(11f / Level.STEPS);
				yield return null;
			}
			LevelVisibility.load();
			LoadingUI.updateProgress(12f / Level.STEPS);
			yield return null;
			if (Level.loadingSteps != null)
			{
				Level.loadingSteps();
			}
			yield return null;
			LevelBarricades.load();
			yield return null;
			LevelStructures.load();
			Level._hash = Hash.combine(new byte[][]
			{
				Level.getLevelHash(Level.info.path),
				LevelGround.hash,
				LevelLighting.hash,
				LevelObjects.hash
			});
			Physics.gravity = new Vector3(0f, Level.info.configData.Gravity, 0f);
			yield return null;
			Resources.UnloadUnusedAssets();
			GC.Collect();
			yield return null;
			Level._editing = new GameObject().transform;
			Level.editing.name = "Editing";
			Level.editing.parent = Level.level;
			if (Level.isEditor)
			{
				Level.mapper = ((GameObject)Object.Instantiate(Resources.Load("Edit/Mapper"))).transform;
				Level.mapper.name = "Mapper";
				Level.mapper.parent = Level.editing;
				Level.mapper.position = new Vector3(0f, 1028f, 0f);
				Level.mapper.rotation = Quaternion.Euler(90f, 0f, 0f);
				Level.mapper.GetComponent<Camera>().orthographicSize = (float)(Level.size / 2 - Level.border);
				if (Level.isDevkit)
				{
					GameObject gameObject = Object.Instantiate<GameObject>(Resources.Load<GameObject>("Edit2/Editor"));
					if (gameObject != null)
					{
						gameObject.name = "Editor";
						gameObject.transform.parent = Level.editing;
					}
				}
				else
				{
					Transform transform = ((GameObject)Object.Instantiate(Resources.Load((!Level.isVR) ? "Edit/Editor" : "Edit/VR"))).transform;
					transform.name = "Editor";
					transform.parent = Level.editing;
					transform.tag = "Logic";
					transform.gameObject.layer = LayerMasks.LOGIC;
				}
			}
			yield return null;
			if (Level.onPrePreLevelLoaded != null)
			{
				Level.onPrePreLevelLoaded(id);
			}
			yield return null;
			if (Level.onPreLevelLoaded != null)
			{
				Level.onPreLevelLoaded(id);
			}
			yield return null;
			if (Level.onLevelLoaded != null)
			{
				Level.onLevelLoaded(id);
			}
			yield return null;
			if (Level.onPostLevelLoaded != null)
			{
				Level.onPostLevelLoaded(id);
			}
			yield return null;
			if (!Level.isEditor && Level.info != null && Level.info.hasTriggers)
			{
				Transform transform2 = null;
				string text = Level.info.name.ToLower();
				if (text != null)
				{
					if (!(text == "germany"))
					{
						if (!(text == "pei"))
						{
							if (!(text == "russia"))
							{
								if (text == "tutorial")
								{
									transform2 = ((GameObject)Object.Instantiate(Resources.Load("Level/Triggers_Tutorial"))).transform;
								}
							}
							else
							{
								transform2 = ((GameObject)Object.Instantiate(Resources.Load("Level/Triggers_Russia"))).transform;
							}
						}
						else
						{
							transform2 = ((GameObject)Object.Instantiate(Resources.Load("Level/Triggers_PEI"))).transform;
						}
					}
					else
					{
						transform2 = ((GameObject)Object.Instantiate(Resources.Load("Level/Triggers_Germany"))).transform;
					}
				}
				if (transform2 != null)
				{
					transform2.position = Vector3.zero;
					transform2.rotation = Quaternion.identity;
					transform2.name = "Triggers";
					transform2.parent = Level.clips;
				}
			}
			yield return null;
			Level._isLoaded = true;
			Level.isLoadingContent = false;
			yield break;
		}