public void SetRenderRule(WorldMode viewerInWorld, int realWStencil, int virtualWStencil) { if (viewerInWorld == WorldMode.VRWorld) { foreach (MeshRenderer rnd in renderers) { // now we don't change the see-thru camera and virtual world camera depth order, so this is not needed rnd.material.SetFloat("_StencilValue", realWStencil); } foreach (ParticleSystemRenderer particle in effectRnds) { particle.gameObject.layer = LayerMask.NameToLayer("Default"); // move to the default camera (make sure it's rendered later) } } else { foreach (MeshRenderer rnd in renderers) { // now we don't change the see-thru camera and virtual world camera depth order, so this is not needed rnd.material.SetFloat("_StencilValue", virtualWStencil); } foreach (ParticleSystemRenderer particle in effectRnds) { particle.gameObject.layer = LayerMask.NameToLayer("VirtualWorldLayer"); } } }
public void SetClippingPlaneEnable(Renderer[] targetRnds, bool flag, WorldMode clipInWorld) { try { if (flag == false) { foreach (Renderer rnd in targetRnds) { foreach (Material mat in rnd.materials) { mat.DisableKeyword("CLIP_PLANE"); } } return; } Vector4 planeEquation = (clipInWorld == WorldMode.RealWorld) ? hitPortal.planeEquation : -hitPortal.planeEquation; foreach (Renderer rnd in targetRnds) { foreach (Material mat in rnd.materials) { mat.EnableKeyword("CLIP_PLANE"); mat.SetVector("_ClipPlane", planeEquation); } } } catch (System.Exception e) { Debug.LogWarning("Null Exception on PortalTraveller:" + gameObject.name + "," + e.Message); } }
private void HandleGameModeChange(WorldMode mode) { if (mode == WorldMode.Play) { engine.InitializeGame(); } }
/// <summary> /// Delegate called when the world state begins transitioning /// </summary> private void HandleModeTransition(WorldMode startingMode, WorldMode targetMode) { var id = saveManager.ActiveSaveId; switch (startingMode) { case WorldMode.Build: // From Build -> Build, just load from the save file if (targetMode == WorldMode.Build) { generator.Clear(); LoadFromSave(saveManager[id, JsonSaveType.File]); } else { // Otherwise, save to buffer, and load from it SaveToBuffer(); generator.Clear(); LoadFromSave(saveManager[id, JsonSaveType.Buffer]); } break; case WorldMode.Play: // From Play -> Build, clear the generator, and load from buffer generator.Clear(); LoadFromSave(saveManager[id, JsonSaveType.Buffer]); break; } }
// Token: 0x06002198 RID: 8600 RVA: 0x00401380 File Offset: 0x003FF580 public void SwitchWorldMode(WorldMode in_nextWorldMode) { if (DataManager.StageDataController.currentWorldMode != in_nextWorldMode) { this.nextWorldMode = in_nextWorldMode; } }
/// <summary> /// Callback when the world is clicked /// </summary> /// <param name="location"> Click location on screen </param> public void OnClick(Vector2 location) { if (mode == WorldMode.MovingBuilding) { draggedBuilding.StopDragging(); mode = WorldMode.None; } else { if (contextMenu.State == MenuState.Active) { contextMenu.OnClick(location); } else { var building = (BuildingEntity)FindEntity(location, EntityType.Building); if (building != null) { contextMenu.Open(building); } } } }
internal bool IsApplied(WorldMode worldMode) { return((WorldMode.Standalone == worldMode) || (ApplyDomain.NetMultiple == this.Domain) || (ApplyDomain.Client == this.Domain && WorldMode.Client == worldMode) || (ApplyDomain.Server == this.Domain && WorldMode.Server == worldMode)); }
private void HandleWorldModeChangeEvent(WorldMode mode) { var shouldDisplay = this.mode == mode; group.alpha = shouldDisplay ? 1f : 0f; group.interactable = shouldDisplay; group.blocksRaycasts = shouldDisplay; }
private void HandleWorldChangeEvent(WorldMode mode) { bool active = mode == primaryMode; foreach (var obj in activeObjects) { obj.SetActive(active); } }
private void CheckWorldSide(ViveSR_Portal portal) { Vector3 selfPos = transform.position; Vector4 testPoint = new Vector4(selfPos.x, selfPos.y, selfPos.z, 1.0f); isInRealWorld = (Vector4.Dot(portal.planeEquation, testPoint) >= 0); isInVirtualWorld = !isInRealWorld; currentWorld = (isInRealWorld ? WorldMode.RealWorld : WorldMode.VRWorld); }
// Token: 0x060013FD RID: 5117 RVA: 0x00233C80 File Offset: 0x00231E80 public MapSpriteManager(WorldMode worldmode, ushort Count) { if (Count == 0) { return; } this.worldmode = worldmode; this.GameObjectCount = Count; this.GameObjectPool = new GameObject[(int)this.GameObjectCount]; this.Initial(); }
public void SetDragging(BuildingEntity building) { mode = WorldMode.MovingBuilding; if (draggedBuilding != null) { draggedBuilding.SetDragging(false); } draggedBuilding = building; draggedBuilding.SetDragging(true); }
/// <summary> /// Delegate called whent the world mode begins its transiton /// </summary> /// <param name="start">The starting phase of the transition</param> /// <param name="end">The ending phase of the transition</param> private void HandleWorldModeTransition(WorldMode start, WorldMode end) { if (start == WorldMode.Play && end == WorldMode.Build) { if (inventory != null) { inventory.OnItemAdd -= HandleInventoryChangeEvent; inventory.OnItemRemove -= HandleInventoryChangeEvent; inventory.OnItemEquip -= HandleEquipEvent; } } }
/// <summary> /// Delegate called when the world mode changes /// </summary> /// <param name="mode">The current world mode</param> private void HandleWorldModeChange(WorldMode mode) { if (mode == WorldMode.Play) { inventory = Player.Instance.inventory; if (inventory != null) { inventory.OnItemAdd += HandleInventoryChangeEvent; inventory.OnItemRemove += HandleInventoryChangeEvent; inventory.OnItemEquip += HandleEquipEvent; } } }
IEnumerator CheckViewerInWorld() { while (isPortalOn) { if (PortalManager.viewerInWorld != oldMode) { MatchControllerWorld(); UpdateBGStencil(); oldMode = PortalManager.viewerInWorld; } yield return(new WaitForEndOfFrame()); } }
private void HandleWorldModeChange(WorldMode mode) { var animator = GetComponent <Animator> (); animator?.SetTrigger("Reset"); var player = Player.Instance; if (player != null) { player.inventory?.Clear(); player.health.health = player.health.maxHealth; } }
public MarsWorld(Camera camera, Play parent) { this.camera = camera; this.parent = parent; director = new GameplayDirector(this); entities = new List <Entity>(); projectiles = new List <Projectile>(); bank = new ResourceBank(); mode = WorldMode.None; }
public TileWorld(FeatureWorld features, int height, int width, IWorldHolder holder, WorldMode mode, CivilizationManager civilizationManager, bool wrapVertical, bool wrapHorizontal) { Height = height; Width = width; FeatureWorld = features; WorldType = holder.WorldType; Holder = holder; Mode = mode; CivilizationManager = civilizationManager; WrapVertical = wrapVertical; WrapHorizontal = wrapHorizontal; _worldData = new BitVector32[height, width, features.GetTileSize(WorldType)]; }
/// <summary> /// Sets the current world mode /// </summary> public void SetCurrentMode(WorldMode mode) { // Invoke the event to notify other scripts that the world mode is changing eventTable?.Invoke <WorldMode, WorldMode> ("OnWorldModeTransition", currentMode, mode); currentMode = mode; motor.CanMove = mode == WorldMode.Play; cameraFollower.CanFollowTarget = mode == WorldMode.Play; scriptManager.AllowScriptRunning = mode == WorldMode.Play; SetMouseVisibilityState(mode == WorldMode.Build); // Invoke the event to notify other scripts that the world mode has changed eventTable?.Invoke <WorldMode> ("OnWorldModeChange", mode); }
private void CheckTransitioningBehavious() { if (isTransitioning != prevIsTransitioning) { prevIsTransitioning = isTransitioning; // viewer is changing transitioning....this fixes flickering issue if (isPlayer) { if (isTransitioning) { originalScale = hitPortalRnd.transform.localScale; hitPortalRnd.transform.localPosition = new Vector3(0, 0, isInRealWorld ? -4 : 4); hitPortalRnd.transform.localScale = new Vector3(30, 3.9f, 30); } else { hitPortalRnd.transform.localPosition = Vector3.zero; hitPortalRnd.transform.localScale = originalScale; } } // item is changing transitioning.... else { // rendering duplicated go: if (dupRenderers == null || dupRenderers.Length == 0) { InitDuplicatedRenderer(); } // when become transitioning, render duplicated item in other world if (isTransitioning) { WorldMode dupItemWorld = (isInVirtualWorld ? WorldMode.RealWorld : WorldMode.VRWorld); SwitchMaterials(dupRenderers, dupItemWorld); SwitchTransitioningMaterials(); SetClippingPlaneEnable(dupRenderers, true, dupItemWorld); } foreach (Renderer dupRnd in dupRenderers) { dupRnd.enabled = isTransitioning; } } } // end if status is switched }
// Token: 0x060021A2 RID: 8610 RVA: 0x00401B18 File Offset: 0x003FFD18 private IObserver CreateWorldMode(WorldMode wm) { IObserver result = null; this.initCorpsStage(); if (wm != WorldMode.Wild) { if (wm == WorldMode.OpenUp) { result = new OpenUp(this.CorpsStageGameObject); } } else { result = new Wild(this.CorpsStageGameObject); } return(result); }
public void SwitchMaterials(Renderer[] targetRnds, WorldMode toWorld) { try { if (toWorld == WorldMode.RealWorld) { foreach (Renderer rnd in targetRnds) { rnd.gameObject.layer = LayerMask.NameToLayer("Default"); foreach (Material mat in rnd.materials) { mat.SetFloat("_StencilValue", portalMgr.realWorldStencilValue); mat.SetFloat("_StencilComp", (float)UnityEngine.Rendering.CompareFunction.Equal); } } } else // ( VRWorld ) { foreach (Renderer rnd in targetRnds) { rnd.gameObject.layer = LayerMask.NameToLayer("VirtualWorldLayer"); foreach (Material mat in rnd.materials) { mat.SetFloat("_StencilValue", portalMgr.virtualWorldStencilValue); //mat.SetFloat("_StencilComp", (float)UnityEngine.Rendering.CompareFunction.Equal); // both is virtual world, the v-world layer is rendered after portal stencil is written but we don't want traveler to be culled by stencil if (portalMgr.viewerInWorld == WorldMode.VRWorld) { mat.SetFloat("_StencilComp", (float)UnityEngine.Rendering.CompareFunction.Disabled); } else { mat.SetFloat("_StencilComp", (float)UnityEngine.Rendering.CompareFunction.Equal); } } } } } catch (System.Exception e) { Debug.LogWarning("Null Exception on PortalTraveller:" + gameObject.name + "," + e.Message); } }
private void HandleWorldModeChangeEvent(WorldMode mode) { switch (mode) { case WorldMode.Play: if (UseDayNightCycle) { StopAllCoroutines(); currentTime = StartTime; StartCoroutine(PlayDayNightCycle()); } break; case WorldMode.Build: StopAllCoroutines(); ApplyTime(time); ApplyDomeColor(time); break; } }
public World(WorldMode mode = WorldMode.Standalone) { this.Mode = mode; this.filters.Active(); this.defaultCreator = new Creator(AllocUniqueId(), this); }
private void HandleModeTransition(WorldMode start, WorldMode end) { pool.Clear(); }
// Token: 0x06001185 RID: 4485 RVA: 0x001EB188 File Offset: 0x001E9388 public MapSprite(WorldMode Type, ushort SpriteNum = 1) { this.Type = Type; if (SpriteNum == 0) { return; } GUIManager.Instance.InitMapSprite(); if (this.Type == WorldMode.Wild) { this.MapSpriteRoot = new GameObject("Build"); SpriteNum = (ushort)((byte)GUIManager.Instance.BuildingData.GetCurrentChapterBuildCount()); this.mapspriteManager = new MapSpriteManager(this.Type, (SpriteNum + 7) * 5); this.GuildPoint = new GameObject("ManorGuild", new Type[] { typeof(SpriteRenderer) }).GetComponent <SpriteRenderer>(); this.GuildPoint.sprite = this.mapspriteManager.GetSpriteByName("arrow"); this.GuildPoint.material = this.mapspriteManager.SpriteMaterial; this.GuildPoint.color = Color.black; this.GuildPoint.sortingOrder = -1; this.GuildPoint.transform.localScale *= 10f; this.DiamonAct = new GameObject("ManorDiamon", new Type[] { typeof(SpriteRenderer) }).GetComponent <SpriteRenderer>(); this.DiamonAct.sprite = this.mapspriteManager.GetSpriteByName("prompt_06"); this.DiamonAct.material = this.mapspriteManager.SpriteMaterial; this.DiamonAct.color = Color.black; this.DiamonAct.sortingOrder = -1; this.DiamonAct.transform.localScale *= 10f; this.DiamonAct.transform.localPosition = new Vector3(-9.92f, 6.41f, 126.48f); Quaternion localRotation = this.GuildPoint.transform.localRotation; localRotation.eulerAngles = GUIManager.Instance.BuildingData.BuildRot; this.GuildPoint.transform.localRotation = localRotation; this.GuildPoint.enabled = false; this.DiamonAct.transform.localRotation = localRotation; this.DiamonAct.enabled = false; this.HeroBuild = new Build(); this.ArenaBuild = new Build(); this.DugoutBuild = new Build(); this.Fortress = new Build(); this.BlackMarket = new Build(); this.Laboratory = new Build(); this.Carsino = new Build(); this.SpriteGameObject = new GameObject[(int)(SpriteNum + 7)]; this.StageLock = new GameObject[DataManager.StageDataController.CorpsStageTable.TableCount]; this.StageLockNameCode = new int[this.StageLock.Length]; } else { this.MapSpriteRoot = new GameObject("Stage"); this.mapspriteManager = new MapSpriteManager(this.Type, SpriteNum * 5); this.mapspriteManager.InitTextObj(SpriteNum); this.SpriteGameObject = new GameObject[(int)SpriteNum]; } GUIManager.Instance.BuildingData.mapspriteManager = this.mapspriteManager; this.BuildSpritesMax = SpriteNum; this.Builds = new SpriteBase[(int)this.BuildSpritesMax]; this.Initial(); this.BuildMotion = new EasingEffect(); this.BuildMotion.Motion = this; }
/// <summary> /// New a world instance. /// </summary> /// <param name="worldMode">World running mode.</param> /// <returns>IWorld instance.</returns> public static IWorld New(WorldMode worldMode = WorldMode.Standalone) { return(new World(worldMode)); }
private void HandleWorldModeChange(WorldMode mode) { currentMode = mode; }
public void SetMode(WorldMode mode, object[] args) { this.selectedMode = mode; this.modeArgs = args; }