-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from Auros/bsipa-4.3.0
BSIPA 4.3.0
- Loading branch information
Showing
17 changed files
with
215 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
using SiraUtil.Interfaces; | ||
using UnityEngine; | ||
using Zenject; | ||
|
||
namespace SiraUtil.Suite.Tests.Sabers | ||
{ | ||
internal class TestSaberModelController : SaberModelController, IColorable | ||
internal class TestSaberModelController : SaberModelController, IColorable, IPreSaberModelInit | ||
{ | ||
public Color Color { get; set; } | ||
|
||
public override void Init(Transform parent, Saber saber) | ||
[Inject] | ||
private readonly ColorManager _colorManager = null!; | ||
|
||
public void PreInit(Transform parent, Saber saber) | ||
{ | ||
Color = _colorManager.ColorForSaberType(saber.saberType); | ||
GameObject g = GameObject.CreatePrimitive(PrimitiveType.Sphere); | ||
g.transform.localScale *= 0.1f; | ||
g.transform.SetParent(transform); | ||
g.transform.localPosition = new Vector3(0f, 0f, 1f); | ||
base.Init(parent, saber); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using UnityEngine; | ||
|
||
namespace SiraUtil.Interfaces | ||
{ | ||
/// <summary> | ||
/// Defines for something to be run after a saber model initializes. | ||
/// </summary> | ||
public interface IPostSaberModelInit | ||
{ | ||
/// <summary> | ||
/// Runs after model initialization. | ||
/// </summary> | ||
/// <param name="parent">The parent of the saber model.</param> | ||
/// <param name="saber">The saber component associated with the current model.</param> | ||
void PostInit(Transform parent, Saber saber); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using UnityEngine; | ||
|
||
namespace SiraUtil.Interfaces | ||
{ | ||
/// <summary> | ||
/// Defines for something to be run before a saber model initializes. | ||
/// </summary> | ||
public interface IPreSaberModelInit | ||
{ | ||
/// <summary> | ||
/// Runs before model initialization. | ||
/// </summary> | ||
/// <param name="parent">The parent of the saber model.</param> | ||
/// <param name="saber">The saber component associated with the current model.</param> | ||
/// <returns>Do you want the original Init to run?</returns> | ||
bool PreInit(Transform parent, Saber saber); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.