public void CreateChatUI(NodeAddedEvent e, LobbyChatNode chat)
        {
            MatchLobbyGUIComponent component = MainScreenComponent.Instance.GetComponent <HomeScreenComponent>().BattleLobbyScreen.GetComponent <MatchLobbyGUIComponent>();
            EntityBehaviour        behaviour = component.chat.GetComponent <EntityBehaviour>();

            if (behaviour.Entity != null)
            {
                behaviour.DestroyEntity();
            }
            EntityBehaviour behaviour2 = component.chat.GetComponent <ChatUIComponent>().MessagesContainer.GetComponent <EntityBehaviour>();

            if (behaviour2.Entity != null)
            {
                behaviour2.DestroyEntity();
            }
            behaviour.BuildEntity(base.CreateEntity("LobbyChat"));
            behaviour2.BuildEntity(base.CreateEntity("LobbyChatContent"));
            chat.Entity.AddComponent <ActiveBattleChannelComponent>();
        }
Example #2
0
        public void CreateBattleCamera(NodeAddedEvent evt, SingleNode <MapInstanceComponent> node)
        {
            Transform  transform  = new GameObject("BattleCameraRoot").transform;
            GameObject obj3       = GameObject.Find(ClientGraphicsConstants.MAIN_CAMERA_NAME);
            Transform  transform2 = obj3.transform;

            transform.SetPositionSafe(transform2.position);
            transform.SetRotationSafe(transform2.rotation);
            transform.SetParent(node.component.SceneRoot.transform, true);
            transform2.SetParent(transform, true);
            Entity          entity    = base.CreateEntity(typeof(CameraTemplate), "camera");
            EntityBehaviour component = obj3.GetComponent <EntityBehaviour>();

            if (component.Entity != null)
            {
                component.DestroyEntity();
            }
            component.BuildEntity(entity);
            entity.AddComponent(new CameraRootTransformComponent(transform));
            entity.AddComponent <BattleCameraComponent>();
            Camera unityCamera = obj3.GetComponent <Camera>();

            entity.AddComponent(new CameraComponent(unityCamera));
            CameraTransformDataComponent component2 = new CameraTransformDataComponent();
            TransformData data = new TransformData {
                Position = transform2.position,
                Rotation = transform2.rotation
            };

            component2.Data = data;
            entity.AddComponent(component2);
            entity.AddComponent <CameraFOVUpdateComponent>();
            entity.AddComponent <BezierPositionComponent>();
            entity.AddComponent <ApplyCameraTransformComponent>();
            entity.AddComponent <TransitionCameraComponent>();
            entity.AddComponent(new CameraShakerComponent(obj3.AddComponent <CameraShaker>()));
            BurningTargetBloomComponent component4 = new BurningTargetBloomComponent {
                burningTargetBloom = unityCamera.GetComponent <BurningTargetBloom>()
            };

            entity.AddComponent(component4);
            this.SetupCameraESM(entity);
        }