Skip to content

Commit

Permalink
[v0.1.0] Add SliderRef
Browse files Browse the repository at this point in the history
  • Loading branch information
g0dzZz-coder committed Dec 6, 2023
1 parent 38d24d5 commit f79bfca
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
2 changes: 0 additions & 2 deletions Runtime/RigidbodyRef.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
// © 2023 Nikolay Melnikov <n.melnikov@depra.org>

using System;
using UnityEngine;

namespace Depra.Ecs.Components
{
[Serializable]
public struct RigidbodyRef
{
public Rigidbody Value;
Expand Down
12 changes: 12 additions & 0 deletions Runtime/SliderRef.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: Apache-2.0
// © 2023 Nikolay Melnikov <n.melnikov@depra.org>

using UnityEngine.UI;

namespace Depra.Ecs.Components
{
public struct SliderRef
{
public Slider Value;
}
}
3 changes: 3 additions & 0 deletions Runtime/SliderRef.cs.meta

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

4 changes: 3 additions & 1 deletion Runtime/UnityComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ namespace Depra.Ecs.Components
public sealed class UnityComponents : IWorldRegistry
{
public ComponentPool<CameraRef> Cameras { get; private set; }
public ComponentPool<SliderRef> Sliders { get; private set; }
public ComponentPool<AnimatorRef> Animators { get; private set; }
public ComponentPool<TransformRef> Transforms { get; private set; }
public ComponentPool<RigidbodyRef> Rigidbodies { get; private set; }
public ComponentPool<LineRendererRef> LineRenderers { get; private set; }
public ComponentPool<RigidbodyForceMode> ForceModes { get; private set; }
public ComponentPool<RigidbodyForceMode> ForceModes { get; private set; }
public ComponentPool<CharacterControllerRef> CharacterControllers { get; private set; }

void IWorldRegistry.Initialize(World world)
{
world.AddRegistry(this);
world.AddPool(Cameras = new ComponentPool<CameraRef>());
world.AddPool(Sliders = new ComponentPool<SliderRef>());
world.AddPool(Animators = new ComponentPool<AnimatorRef>());
world.AddPool(Transforms = new ComponentPool<TransformRef>());
world.AddPool(Rigidbodies = new ComponentPool<RigidbodyRef>());
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "com.depra.ecs.components",
"version": "0.0.9",
"version": "0.1.0",
"displayName": "Depra.Ecs.Components",
"description": "Components for Unity types.",
"unity": "2022.3",
"license": "Apache-2.0",
"keywords": [
"Depra",
"Ecs",
"Unity",
"Components"
"depra",
"ecs",
"unity",
"components"
],
"author": {
"name": "Depra, Inc.",
Expand Down

0 comments on commit f79bfca

Please sign in to comment.