Skip to content

Commit bdbe2be

Browse files
committed
Created Curtain logic and Infrastructure for test curtain
1 parent add6b0f commit bdbe2be

File tree

1,033 files changed

+68741
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,033 files changed

+68741
-1
lines changed

.gitignore

Lines changed: 662 additions & 0 deletions
Large diffs are not rendered by default.

Curtain/Assets/Internal.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Curtain/Assets/Internal/Codebase.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Curtain/Assets/Internal/Codebase/Infrastructure.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Curtain/Assets/Internal/Codebase/Infrastructure/AssetManagement.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// **************************************************************** //
2+
//
3+
// Copyright (c) RimuruDev. All rights reserved.
4+
// Contact me:
5+
// - Gmail: rimuru.dev@gmail.com
6+
// - GitHub: https://github.com/RimuruDev
7+
// - LinkedIn: https://www.linkedin.com/in/rimuru/
8+
// - GitHub Organizations: https://github.com/Rimuru-Dev
9+
//
10+
// **************************************************************** //
11+
12+
namespace RimuruDev.Internal.Codebase.Infrastructure.AssetManagement
13+
{
14+
public readonly struct AssetPath
15+
{
16+
public const string Curtain = "StaticData/Curtain/CurtainConfig";
17+
}
18+
}

Curtain/Assets/Internal/Codebase/Infrastructure/AssetManagement/AssetPath.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// **************************************************************** //
2+
//
3+
// Copyright (c) RimuruDev. All rights reserved.
4+
// Contact me:
5+
// - Gmail: rimuru.dev@gmail.com
6+
// - GitHub: https://github.com/RimuruDev
7+
// - LinkedIn: https://www.linkedin.com/in/rimuru/
8+
// - GitHub Organizations: https://github.com/Rimuru-Dev
9+
//
10+
// **************************************************************** //
11+
12+
using System;
13+
using Zenject;
14+
using UnityEngine;
15+
using Object = UnityEngine.Object;
16+
using RimuruDev.Internal.Codebase.Infrastructure.Services.Resource;
17+
18+
namespace RimuruDev.Internal.Codebase.Infrastructure.AssetManagement
19+
{
20+
public sealed class AssetProvider : IAssetProvider
21+
{
22+
private readonly IResourceLoaderService resourceLoader;
23+
24+
[Inject]
25+
public AssetProvider(IResourceLoaderService resourceLoader)
26+
{
27+
this.resourceLoader = resourceLoader;
28+
}
29+
30+
public GameObject Instantiate(string path)
31+
{
32+
if (string.IsNullOrEmpty(path))
33+
throw new ArgumentException(path);
34+
35+
var prefab = resourceLoader.Load<GameObject>(path);
36+
37+
return Object.Instantiate(prefab);
38+
}
39+
40+
public T Instantiate<T>(string path, Transform parent = null) where T : Object
41+
{
42+
if (string.IsNullOrEmpty(path))
43+
throw new ArgumentException(path);
44+
45+
var prefab = resourceLoader.Load<T>(path);
46+
47+
return Object.Instantiate(prefab, parent);
48+
}
49+
50+
public TPrefab Instantiate<TPrefab>(TPrefab prefab, Transform parent = null) where TPrefab : Object
51+
{
52+
if (prefab == null)
53+
throw new ArgumentNullException(nameof(prefab));
54+
55+
return Object.Instantiate(prefab, parent);
56+
}
57+
}
58+
}

Curtain/Assets/Internal/Codebase/Infrastructure/AssetManagement/AssetProvider.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// **************************************************************** //
2+
//
3+
// Copyright (c) RimuruDev. All rights reserved.
4+
// Contact me:
5+
// - Gmail: rimuru.dev@gmail.com
6+
// - GitHub: https://github.com/RimuruDev
7+
// - LinkedIn: https://www.linkedin.com/in/rimuru/
8+
// - GitHub Organizations: https://github.com/Rimuru-Dev
9+
//
10+
// **************************************************************** //
11+
12+
using UnityEngine;
13+
14+
namespace RimuruDev.Internal.Codebase.Infrastructure.AssetManagement
15+
{
16+
public interface IAssetProvider
17+
{
18+
public T Instantiate<T>(string path, Transform parent = null) where T : Object;
19+
public TPrefab Instantiate<TPrefab>(TPrefab prefab, Transform parent = null) where TPrefab : Object;
20+
}
21+
}

0 commit comments

Comments
 (0)