public void OnPreRender() { BlobShadowRenderer blobShadowRenderer = SceneRefs.Get <BlobShadowRenderer>(); if (blobShadowRenderer != null) { blobShadowRenderer.RenderBlobs(); } }
public void OnEnable() { if (SceneRefs.IsSet <IScreenContainerStateHandler>()) { isShowingKeyboard = SceneRefs.Get <IScreenContainerStateHandler>().IsKeyboardShown; } Service.Get <EventDispatcher>().AddListener <KeyboardEvents.KeyboardHidden>(onKeyboardHidden); Service.Get <EventDispatcher>().AddListener <KeyboardEvents.KeyboardShown>(onKeyboardShown); }
private void setup() { referencesRemovedCount = 0; contentCacheGameObject = SceneRefs.Get <PrefabCacheTracker>(); if (contentCacheGameObject != null) { contentCacheGameObject.ReferencesRemoved += onReferencesRemoved; } Service.Get <EventDispatcher>().AddListener <SceneTransitionEvents.SceneSwapLoadStarted>(onSceneSwapLoadStarted); isSetup = true; }
public void OnDestroy() { if (dispatcher != null) { dispatcher.DispatchEvent(new InputEvents.MoveEvent(Vector2.zero)); } if (SceneRefs.IsSet <VirtualJoystick>() && SceneRefs.Get <VirtualJoystick>() == this) { SceneRefs.Remove(this); } }
protected override void handleEvent() { if (SceneRefs.Get <IScreenContainerStateHandler>().IsKeyboardShown) { Service.Get <EventDispatcher>().AddListener <KeyboardEvents.KeyboardHidden>(onKeyboardClosed); } else { base.handleEvent(); } }
public void Start() { if (SceneRefs.IsSet <BlobShadowRenderer>()) { blobShadowRenderer = SceneRefs.Get <BlobShadowRenderer>(); SetIsActive(blobShadowRenderer.IsShadowsVisible); } eventDispatcher.AddListener <BlobShadowEvents.DisableBlobShadows>(onDisableBlobShadows); eventDispatcher.AddListener <BlobShadowEvents.EnableBlobShadows>(onEnableBlobShadows); ScaleX = 0.6f; ScaleZ = 0.6f; }
private void Awake() { if (SceneRefs.IsSet <VirtualJoystick>()) { SceneRefs.Remove(SceneRefs.Get <VirtualJoystick>()); } SceneRefs.Set(this); joystick = GetComponent <RectTransform>(); joystickBase = base.transform.GetChild(0).GetComponent <RectTransform>(); joystickPad = base.transform.GetChild(0).GetChild(0).GetComponent <RectTransform>(); dispatcher = Service.Get <EventDispatcher>(); }
public void Start() { if (SceneRefs.IsSet <BlobShadowRenderer>()) { this.blobShadowRenderer = SceneRefs.Get <BlobShadowRenderer>(); this.SetIsActive(this.blobShadowRenderer.IsShadowsVisible); } this.eventDispatcher.AddListener <BlobShadowEvents.DisableBlobShadows>(new EventHandlerDelegate <BlobShadowEvents.DisableBlobShadows>(this.onDisableBlobShadows), EventDispatcher.Priority.DEFAULT); this.eventDispatcher.AddListener <BlobShadowEvents.EnableBlobShadows>(new EventHandlerDelegate <BlobShadowEvents.EnableBlobShadows>(this.onEnableBlobShadows), EventDispatcher.Priority.DEFAULT); this.ScaleX = 0.6f; this.ScaleZ = 0.6f; }
public void Start() { if (objectManipulationInputController != null) { objectManipulationInputController.InteractionStateChanged += OnObjectManipulationInputControllerInteractionStateChanged; } if (SceneRefs.IsSet <SceneManipulationService>()) { sceneManipulationService = SceneRefs.Get <SceneManipulationService>(); sceneManipulationService.ObjectRemoved += onSceneManipulationServiceObjectRemoved; } Service.Get <EventDispatcher>().AddListener <ObjectManipulationEvents.ConfirmPlacementSelectedItemEvent>(OnConfirmPlacementSelectedItemEvent, EventDispatcher.Priority.FIRST); }
public void OnDestroy() { if (objectManipulationInputController != null) { objectManipulationInputController.InteractionStateChanged -= OnObjectManipulationInputControllerInteractionStateChanged; } if (SceneRefs.IsSet <SceneManipulationService>()) { sceneManipulationService = SceneRefs.Get <SceneManipulationService>(); sceneManipulationService.ObjectRemoved -= onSceneManipulationServiceObjectRemoved; } Service.Get <EventDispatcher>().RemoveListener <ObjectManipulationEvents.ConfirmPlacementSelectedItemEvent>(OnConfirmPlacementSelectedItemEvent); }
private void Update() { if (SceneRefs.IsSet <BaseCamera>()) { Transform transform = SceneRefs.Get <BaseCamera>().transform; Transform transform2 = base.transform; if ((bool)AttachPoint) { transform2.position = AttachPoint.position; } transform2.LookAt(transform2.position + transform.rotation * Vector3.forward, transform.rotation * Vector3.up); } }
internal override List <KeyValuePair <DecorationDefinition, int> > GetDefinitionsToDisplay() { List <KeyValuePair <DecorationDefinition, int> > list = new List <KeyValuePair <DecorationDefinition, int> >(); List <KeyValuePair <DecorationDefinition, int> > availableDecorations = SceneRefs.Get <SceneManipulationService>().GetAvailableDecorations(); for (int i = 0; i < availableDecorations.Count; i++) { if (availableDecorations[i].Key.CategoryKey.Id == categoryDefinition.Id) { list.Add(availableDecorations[i]); } } return(list); }
public void Awake() { dispatcher = Service.Get <EventDispatcher>(); if (SceneRefs.IsSet <VirtualJoystick>()) { joystick = SceneRefs.Get <VirtualJoystick>(); CoroutineRunner.Start(getTopOfJoystickInPixels(), this, "getTopOfJoystickInPixels"); } else { dispatcher.AddListener <VirtualJoystickEvents.JoystickAdded>(onJoystickAdded); } dispatcher.AddListener <CinematographyEvents.DisableElasticGlancer>(onGlancerDisabled); dispatcher.AddListener <CinematographyEvents.EnableElasticGlancer>(onGlancerEnabled); isGlancerEnabled = GlobalGlancersEnabled; }
protected virtual void Start() { if (PooledScrollRect.ElementPoolOverride == null) { goPoolOverride = SceneRefs.Get <GameObjectPoolOverride>(); } displayListRetrieved = false; if (SceneRefs.Get <IScreenContainerStateHandler>().IsOpen) { loadContentPrefabs(); } else { eventDispatcher.AddListener <TrayEvents.TrayOpened>(onTrayOpened); } }
private void setSceneRef() { if (SceneRefs.IsSet <IScreenContainerStateHandler>()) { IScreenContainerStateHandler screenContainerStateHandler = SceneRefs.Get <IScreenContainerStateHandler>(); if (!object.ReferenceEquals(screenContainerStateHandler, this)) { SceneRefs.Remove(screenContainerStateHandler); SceneRefs.Set((IScreenContainerStateHandler)this); } } else { SceneRefs.Set((IScreenContainerStateHandler)this); } }
public void Awake() { canvas = GetComponent <Canvas>(); canvasScalerExt = GetComponent <CanvasScalerExt>(); manipulatableObject = GetComponentInParent <ManipulatableObject>(); decorationInventoryService = Service.Get <DecorationInventoryService>(); confirmButtonImage = ConfirmButton.GetComponent <Image>(); duplicateButtonImage = DuplicateButton.GetComponent <Image>(); baseCamera = SceneRefs.Get <BaseCamera>(); BaseCamera obj = baseCamera; obj.Moved = (System.Action)Delegate.Combine(obj.Moved, new System.Action(OnCameraMoved)); Service.Get <EventDispatcher>().AddListener <InputEvents.ZoomEvent>(onInputZoom); IsInitialized = false; isDecorationSet = false; hide(); }
public void Start() { scaleSlider = GetComponentInChildren <Slider>(); objectManipulationInputController = SceneRefs.Get <ObjectManipulationInputController>(); objectManipulationInputController.InteractionStateChanged += onObjectManipulationInputControllerInteractionStateChanged; objectManipulationInputController.ObjectSelected += onObjectManipulationInputControllerObjectSelected; RotationWheel rotationWheel = RotationWheel; rotationWheel.SelectedStateChanged = (Action <bool>)Delegate.Combine(rotationWheel.SelectedStateChanged, new Action <bool>(OnRotationWheelSelectionStateChanged)); if (PlatformUtils.GetPlatformType() == PlatformType.Mobile) { HideScaleControls(); HideRotationControls(); } else { InitializeControls(); } }
internal override List <KeyValuePair <DecorationDefinition, int> > GetDefinitionsToDisplay() { List <KeyValuePair <DecorationDefinition, int> > list = new List <KeyValuePair <DecorationDefinition, int> >(); if (sceneLayoutData != null) { foreach (DecorationLayoutData item2 in sceneLayoutData.GetLayoutEnumerator()) { DecorationLayoutData current = item2; if (current.Type == DecorationLayoutData.DefinitionType.Decoration && dictionaryOfDecorationDefinitions.ContainsKey(current.DefinitionId)) { DecorationDefinition decorationDefinition = dictionaryOfDecorationDefinitions[current.DefinitionId]; int availableDecorationCount = SceneRefs.Get <SceneManipulationService>().GetAvailableDecorationCount(decorationDefinition.Id); KeyValuePair <DecorationDefinition, int> item = new KeyValuePair <DecorationDefinition, int>(decorationDefinition, availableDecorationCount); if (!list.Contains(item)) { list.Add(item); } } } } if (SceneRefs.IsSet <SceneManipulationService>()) { SceneManipulationService sceneManipulationService = SceneRefs.Get <SceneManipulationService>(); if (sceneManipulationService.IsObjectSelectedForAdd) { ObjectManipulator currentObjectManipulator = sceneManipulationService.ObjectManipulationInputController.CurrentObjectManipulator; if (currentObjectManipulator != null) { int definitionId = currentObjectManipulator.GetComponent <ManipulatableObject>().DefinitionId; DecorationDefinition decorationDefinition = dictionaryOfDecorationDefinitions[definitionId]; int availableDecorationCount = sceneManipulationService.GetAvailableDecorationCount(decorationDefinition.Id); KeyValuePair <DecorationDefinition, int> item = new KeyValuePair <DecorationDefinition, int>(decorationDefinition, availableDecorationCount); if (!list.Contains(item)) { list.Add(item); } } } } return(list); }
public void OnEnable() { Service.Get <EventDispatcher>().AddListener <KeyboardEvents.KeyboardHidden>(onKeyboardHidden); Service.Get <EventDispatcher>().AddListener <KeyboardEvents.KeyboardShown>(onKeyboardShown); if (SceneRefs.IsSet <IScreenContainerStateHandler>()) { IScreenContainerStateHandler screenContainerStateHandler = SceneRefs.Get <IScreenContainerStateHandler>(); if (screenContainerStateHandler.IsKeyboardShown) { setOffset(ref OffsetWithKeyboard); } else { setOffset(ref Offset); } } else { setOffset(ref Offset); } }
protected override void Start() { base.Start(); if (SceneRefs.IsSet <SceneManipulationService>()) { sceneManipulationService = SceneRefs.Get <SceneManipulationService>(); sceneManipulationService.ObjectRemoved += onObjectAddedOrRemoved; sceneManipulationService.ObjectAdded += onObjectAddedOrRemoved; sceneManipulationService.NewObjectCreated += onObjectAddedOrRemoved; } if (SceneRefs.IsSet <ObjectManipulationInputController>()) { objectManipulationInputController = SceneRefs.Get <ObjectManipulationInputController>(); objectManipulationInputController.InteractionStateChanged += onInteractionStateChanged; } recentDecorationsService = Service.Get <RecentDecorationsService>(); decorationInventoryService = Service.Get <DecorationInventoryService>(); decorationCategoryManager = GetComponentInChildren <DecorationCategoryManager>(); if (decorationCategoryManager != null) { DecorationCategoryManager obj = decorationCategoryManager; obj.CategoryRefreshedEvent = (CategoryRefreshedEvent)Delegate.Combine(obj.CategoryRefreshedEvent, new CategoryRefreshedEvent(onCategoryUpdated)); } totalDragHeight = (base.transform as RectTransform).rect.height; GameObject gameObject = GameObject.Find("IglooMenuLoader"); if (gameObject != null) { totalDragHeight += (gameObject.transform as RectTransform).rect.height; } Canvas componentInParent = GetComponentInParent <Canvas>(); if (componentInParent != null) { Assert.AreEqual(componentInParent.transform.localScale.x, componentInParent.transform.localScale.y); totalDragHeight *= componentInParent.transform.localScale.x; } returnToPreviousState = GetComponentInParent <ReturnToFSMStateOnInteractionState>(); }
public void OnTriggerEnter(Collider col) { if (!(col != null) || !col.CompareTag(Tag) || !(col.gameObject != null)) { return; } ChaseCamera chaseCamera = SceneRefs.Get <ChaseCamera>(); if (chaseCamera != null) { if (Action == ActionType.EnableChaseCamera) { chaseCamera.Enable(col.gameObject); } else if (Action == ActionType.SetTrackDirection) { chaseCamera.SetTrackDirection(base.gameObject); } else { chaseCamera.Disable(); } } }
private void Start() { prefabCacheTracker = SceneRefs.Get <PrefabCacheTracker>(); sceneLayoutListener = dataEntityCollection.Whenever <SceneLayoutData>(sceneDataEntityHandle, onLayoutAdded, onLayoutRemoved); }
private void OnEnable() { objectManipulationInputController = SceneRefs.Get <ObjectManipulationInputController>(); objectManipulationInputController.InteractionStateChanged += onObjectManipulationInputControllerInteractionStateChanged; }
public override void OnEnter() { SceneRefs.Get <BaseCamera>().Snap(); Finish(); }
internal override List <KeyValuePair <DecorationDefinition, int> > GetDefinitionsToDisplay() { return(SceneRefs.Get <SceneManipulationService>().GetAvailableDecorations()); }
protected override List <KeyValuePair <StructureDefinition, int> > GetAvailableItems() { return(SceneRefs.Get <SceneManipulationService>().GetAvailableStructures()); }