Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
570d7e4
Pointed protocol to feature branch. Generated classes.
AlejandroAlvarezMelucciDCL Jan 13, 2025
12e4864
First iteration of new component LightSource
AlejandroAlvarezMelucciDCL Jan 16, 2025
39453f9
Added LightSourceSystem World Plugins Container and LightSource prefa…
AlejandroAlvarezMelucciDCL Jan 21, 2025
86e2200
Fixed wrong component being released to the pool
AlejandroAlvarezMelucciDCL Jan 21, 2025
d5db45f
Fixed Transform tweens on entities that also have MaterialComponent t…
AlejandroAlvarezMelucciDCL Jan 23, 2025
7a8aa36
Added LightSource to ResetDirtyFlagSystem
AlejandroAlvarezMelucciDCL Jan 23, 2025
14598d9
Merge branch 'dev' into feat/dynamic-lights
AlejandroAlvarezMelucciDCL Jan 24, 2025
75f58ea
Updated protocol and reverted SocialService.V3 to V2
AlejandroAlvarezMelucciDCL Jan 24, 2025
1fc1ec2
Added full support to tweak LightSource from the SDK. Minor cleanups.
AlejandroAlvarezMelucciDCL Jan 24, 2025
e3a8e0c
Updated protocol
AlejandroAlvarezMelucciDCL Jan 31, 2025
0a8fbdf
Updated protobuf generated class. Small code cleanup and improvements
AlejandroAlvarezMelucciDCL Jan 31, 2025
4e6d6aa
Addressed PR comments. Improved pool object cycle. Added proper suppo…
AlejandroAlvarezMelucciDCL Jan 31, 2025
08a6a1c
Merge branch 'dev' into feat/dynamic-lights
AlejandroAlvarezMelucciDCL Jan 31, 2025
9434230
Fixed referenced scriptable object issue
AlejandroAlvarezMelucciDCL Jan 31, 2025
5cbe598
Fixed starting scene values not being properly set.
AlejandroAlvarezMelucciDCL Feb 1, 2025
148cfef
Small fixes
AlejandroAlvarezMelucciDCL Feb 1, 2025
8ed45b1
Merge branch 'dev' into feat/dynamic-lights
AlejandroAlvarezMelucciDCL Feb 4, 2025
a544ebc
Point protocol to experimental branch
AlejandroAlvarezMelucciDCL Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Explorer/Assets/DCL/Friends/RPCFriendsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using DCL.Profiles;
using DCL.Web3.Chains;
using DCL.Web3.Identities;
using Decentraland.SocialService.V3;
using Decentraland.SocialService.V2;
using Google.Protobuf.WellKnownTypes;
using Newtonsoft.Json;
using rpc_csharp;
Expand Down Expand Up @@ -169,13 +169,13 @@ public async UniTask<FriendshipStatus> GetFriendshipStatusAsync(string userId, C
case GetFriendshipStatusResponse.ResponseOneofCase.Accepted:
switch (response.Accepted.Status)
{
case Decentraland.SocialService.V3.FriendshipStatus.Accepted:
case Decentraland.SocialService.V2.FriendshipStatus.Accepted:
return FriendshipStatus.FRIEND;
case Decentraland.SocialService.V3.FriendshipStatus.Blocked:
case Decentraland.SocialService.V2.FriendshipStatus.Blocked:
return FriendshipStatus.BLOCKED;
case Decentraland.SocialService.V3.FriendshipStatus.RequestReceived:
case Decentraland.SocialService.V2.FriendshipStatus.RequestReceived:
return FriendshipStatus.REQUEST_RECEIVED;
case Decentraland.SocialService.V3.FriendshipStatus.RequestSent:
case Decentraland.SocialService.V2.FriendshipStatus.RequestSent:
return FriendshipStatus.REQUEST_SENT;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,7 @@ public static class ReportCategory
public const string IN_WORLD_CAMERA = nameof(IN_WORLD_CAMERA);

public const string FRIENDS = nameof(FRIENDS);

public const string LIGHT_SOURCE = nameof(LIGHT_SOURCE);
Comment thread
AlejandroAlvarezMelucciDCL marked this conversation as resolved.
}
}
93 changes: 93 additions & 0 deletions Explorer/Assets/DCL/PluginSystem/World/LightSourcePlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
using Arch.SystemGroups;
using Cysharp.Threading.Tasks;
using DCL.AssetsProvision;
using DCL.ECSComponents;
using DCL.Optimization.Pools;
using DCL.PluginSystem.World.Dependencies;
using DCL.ResourcesUnloading;
using DCL.SDKComponents.LightSource.Systems;
using ECS.LifeCycle;
using ECS.LifeCycle.Systems;
using System;
using System.Collections.Generic;
using System.Threading;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.AddressableAssets;
using Object = UnityEngine.Object;

namespace DCL.PluginSystem.World
{
public class LightSourcePlugin : IDCLWorldPlugin<LightSourcePlugin.Settings>
{
private readonly IComponentPoolsRegistry poolsRegistry;
private readonly IAssetsProvisioner assetsProvisioner;
private readonly CacheCleaner cacheCleaner;
private IComponentPool<Light>? lightPoolRegistry;

public LightSourcePlugin(
IComponentPoolsRegistry poolsRegistry,
IAssetsProvisioner assetsProvisioner,
CacheCleaner cacheCleaner)
{
this.assetsProvisioner = assetsProvisioner;
this.poolsRegistry = poolsRegistry;
this.cacheCleaner = cacheCleaner;
}

public void Dispose()
{
throw new NotImplementedException();
Comment thread
AlejandroAlvarezMelucciDCL marked this conversation as resolved.
Outdated
}

public void InjectToWorld(ref ArchSystemsWorldBuilder<Arch.Core.World> builder, in ECSWorldInstanceSharedDependencies sharedDependencies, in PersistentEntities persistentEntities, List<IFinalizeWorldSystem> finalizeWorldSystems, List<ISceneIsCurrentListener> sceneIsCurrentListeners)
{
finalizeWorldSystems.Add(LightSourceSystem.InjectToWorld(
ref builder,
lightPoolRegistry,
sharedDependencies.SceneStateProvider
));

ResetDirtyFlagSystem<PBLightSource>.InjectToWorld(ref builder);
}

public async UniTask InitializeAsync(Settings settings, CancellationToken ct) =>
await CreateLightSourcePoolAsync(settings, ct);

private async UniTask CreateLightSourcePoolAsync(Settings settings, CancellationToken ct)
{
Light light = (await assetsProvisioner.ProvideMainAssetAsync(settings.LightSourcePrefab, ct: ct)).Value.GetComponent<Light>();
lightPoolRegistry = poolsRegistry.AddGameObjectPool(() => Object.Instantiate(light, Vector3.zero, quaternion.identity), onRelease: OnPoolRelease, onGet: OnPoolGet);
cacheCleaner.Register(lightPoolRegistry);
}

private static void OnPoolRelease(Light light)
{
light.enabled = false;
light.transform.SetParent(null);
light.transform.localPosition = Vector3.zero;
light.transform.localRotation = Quaternion.identity;
Comment thread
AlejandroAlvarezMelucciDCL marked this conversation as resolved.
Outdated

light.color = Color.white;
light.intensity = 1;
light.range = 10;
light.shadows = LightShadows.None;
light.type = LightType.Point;

light.innerSpotAngle = 12.8f;
light.spotAngle = 30f;
Comment thread
AlejandroAlvarezMelucciDCL marked this conversation as resolved.
Outdated
}

private static void OnPoolGet(Light light) =>
light.enabled = false;

[Serializable]
public class Settings : IDCLPluginSettings
{
[field: Header(nameof(LightSourcePlugin) + "." + nameof(Settings))]
[field: Space]
[field: SerializeField]
public AssetReferenceGameObject LightSourcePrefab;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MonoBehaviour:
- rid: 634089542387236867
- rid: 1970080267461197826
- rid: 5734404086669770757
- rid: 3414977917307846658
references:
version: 2
RefIds:
Expand Down Expand Up @@ -154,6 +155,14 @@ MonoBehaviour:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
- rid: 3414977917307846658
type: {class: LightSourcePlugin/Settings, ns: DCL.PluginSystem.World, asm: DCL.Plugins}
data:
LightSourcePrefab:
m_AssetGUID: 7f09a2d0d9adc4e43b67879ab9cdf360
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
- rid: 4753057106328551424
type: {class: SceneUIPlugin/Settings, ns: DCL.PluginSystem.World, asm: DCL.Plugins}
data:
Expand Down
3 changes: 3 additions & 0 deletions Explorer/Assets/DCL/SDKComponents/LightSource.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using UnityEngine;

namespace DCL.SDKComponents.LightSource
{
public struct LightSourceComponent
{
public readonly Light lightSourceInstance;

public LightSourceComponent(Light lightSourceInstance)
{
this.lightSourceInstance = lightSourceInstance;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Explorer/Assets/DCL/SDKComponents/LightSource/Prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6702869395793157098
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5232691481928228032}
- component: {fileID: 3601112764250369252}
- component: {fileID: 9216909418390168617}
m_Layer: 0
m_Name: LightSourcePrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5232691481928228032
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6702869395793157098}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &3601112764250369252
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6702869395793157098}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!114 &9216909418390168617
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6702869395793157098}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Explorer/Assets/DCL/SDKComponents/LightSource/Systems.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading