Added TweenThreadVec3. Updated UI elements to use new textures and fonts. Gameplay UI WIP #380

Merged
maverickdgg merged 6 commits from SP3-20-UI-System into main 2023-03-02 12:46:12 +08:00
5 changed files with 268 additions and 77 deletions
Showing only changes of commit 381fe476be - Show all commits

View File

@ -2228,24 +2228,54 @@
gamePauseText: 11 gamePauseText: 11
canvas: 10 canvas: 10
- EID: 199 - EID: 199
Name: =====Text==== Name: Gameplay Canvas
IsActive: true
NumberOfChildren: 3
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true IsActive: true
NumberOfChildren: 4
Components: ~
Scripts: ~ Scripts: ~
- EID: 237 - EID: 237
Name: Score Name: Score Text
IsActive: true
NumberOfChildren: 1
Components:
Transform Component:
Translate: {x: -800, y: 365, z: 0.600000024}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 60}
IsActive: true
Text Renderer Component:
Text: My name is Brandon.
Font: 174412429
IsActive: true
UI Component:
Canvas ID: 199
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 522
Name: Score BG
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -800, y: 400, z: 0} Translate: {x: 0.300000012, y: 0.600000024, z: 0.98999995}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 60, y: 60, z: 60} Scale: {x: 3.45600009, y: 2, z: 1}
IsActive: true IsActive: true
Text Renderer Component: Renderable Component:
Text: My name is Brandon. Mesh: 141771688
Font: 176667660 Material: 127527215
IsActive: true
UI Component:
Canvas ID: 199
Hovered: false
Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 206 - EID: 206
@ -2262,36 +2292,56 @@
Text: My name is Brandon. Text: My name is Brandon.
Font: 176667660 Font: 176667660
IsActive: true IsActive: true
UI Component:
Canvas ID: 199
Hovered: false
Clicked: false
IsActive: true
Scripts: ~ Scripts: ~
- EID: 139 - EID: 139
Name: Multiplier Name: Multiplier Text
IsActive: true
NumberOfChildren: 1
Components:
Transform Component:
Translate: {x: -800, y: 250, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 50, y: 50, z: 60}
IsActive: true
Text Renderer Component:
Text: X2
Font: 174412429
IsActive: true
UI Component:
Canvas ID: 199
Hovered: false
Clicked: false
IsActive: true
Scripts:
- Type: SHADE_Scripting.UI.MultiplierTextFx
Enabled: true
maxSize: 1
minSize: 0.300000012
minAlpha: 0.300000012
- EID: 523
Name: Multiplier BG
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -800, y: 300, z: 0} Translate: {x: 0.400000006, y: 0.400000006, z: 0.98999995}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 60, y: 60, z: 60} Scale: {x: 4.26499987, y: 2, z: 1}
IsActive: true IsActive: true
Text Renderer Component: Renderable Component:
Text: TEST Mesh: 141771688
Font: 176667660 Material: 133784677
IsActive: true IsActive: true
Scripts: ~ UI Component:
- EID: 11 Canvas ID: 199
Name: GamePause Hovered: false
Clicked: false
IsActive: true IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -250, y: 300, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 100}
IsActive: true
Text Renderer Component:
Text: Game Pause
Font: 176667660
IsActive: false
Scripts: ~ Scripts: ~
- EID: 198 - EID: 198
Name: ====Raccoon==== Name: ====Raccoon====
@ -2414,7 +2464,7 @@
armLength: 3 armLength: 3
turnSpeedPitch: 0.200000003 turnSpeedPitch: 0.200000003
turnSpeedYaw: 0.400000006 turnSpeedYaw: 0.400000006
inverseXControls: false inverseXControls: true
inverseYControls: false inverseYControls: false
pitchUpperClamp: 45 pitchUpperClamp: 45
pitchLowerClamp: 5 pitchLowerClamp: 5
@ -4782,9 +4832,9 @@
- Type: JumpPad - Type: JumpPad
Enabled: true Enabled: true
- EID: 10 - EID: 10
Name: Canvas Name: Pause Canvas
IsActive: true IsActive: true
NumberOfChildren: 3 NumberOfChildren: 4
Components: Components:
Canvas Component: Canvas Component:
Canvas Width: 1920 Canvas Width: 1920
@ -4800,23 +4850,31 @@
Transform Component: Transform Component:
Translate: {x: 0, y: 100, z: 0} Translate: {x: 0, y: 100, z: 0}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 300, y: 200, z: 500} Scale: {x: 400, y: 100, z: 500}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 129340704 Material: 129340704
IsActive: true IsActive: true
Button Component: Button Component:
Default Texture: 52901020 Default Texture: 63979907
Hovered Texture: 62235279 Hovered Texture: 51379325
Clicked Texture: 64722619 Clicked Texture: 66788278
IsActive: true IsActive: true
UI Component: UI Component:
Canvas ID: 10 Canvas ID: 10
Hovered: false Hovered: false
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts:
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true
onHoverEnterSound: event:/Music/player_undetected
onHoverExitSound: event:/Music/player_undetected
onClickSound: event:/Music/player_undetected
onReleaseSound: event:/Music/player_undetected
hoverScale: 1.10000002
clickScale: 0.899999976
- EID: 0 - EID: 0
Name: QuitButton Name: QuitButton
IsActive: true IsActive: true
@ -4825,23 +4883,31 @@
Transform Component: Transform Component:
Translate: {x: 0, y: -300, z: 0} Translate: {x: 0, y: -300, z: 0}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 300, y: 200, z: 500} Scale: {x: 400, y: 100, z: 500}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 129340704 Material: 129340704
IsActive: true IsActive: true
Button Component: Button Component:
Default Texture: 66477839 Default Texture: 61602036
Hovered Texture: 65045286 Hovered Texture: 58910810
Clicked Texture: 58607560 Clicked Texture: 57786063
IsActive: true IsActive: true
UI Component: UI Component:
Canvas ID: 10 Canvas ID: 10
Hovered: false Hovered: false
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts:
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true
onHoverEnterSound: event:/Music/player_undetected
onHoverExitSound: event:/Music/player_undetected
onClickSound: event:/Music/player_undetected
onReleaseSound: event:/Music/player_undetected
hoverScale: 1.10000002
clickScale: 0.899999976
- EID: 461 - EID: 461
Name: RetryButton Name: RetryButton
IsActive: true IsActive: true
@ -4850,22 +4916,50 @@
Transform Component: Transform Component:
Translate: {x: 0, y: -100, z: 0} Translate: {x: 0, y: -100, z: 0}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 300, y: 200, z: 500} Scale: {x: 400, y: 100, z: 500}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 129340704 Material: 129340704
IsActive: true IsActive: true
Button Component: Button Component:
Default Texture: 55782622 Default Texture: 64806384
Hovered Texture: 58972174 Hovered Texture: 58347825
Clicked Texture: 55224464 Clicked Texture: 63234380
IsActive: true IsActive: true
UI Component: UI Component:
Canvas ID: 10 Canvas ID: 10
Hovered: false Hovered: false
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts:
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true
onHoverEnterSound: event:/Music/player_undetected
onHoverExitSound: event:/Music/player_undetected
onClickSound: event:/Music/player_undetected
onReleaseSound: event:/Music/player_undetected
hoverScale: 1.10000002
clickScale: 0.899999976
- EID: 11
Name: GamePause
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -250, y: 300, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 100}
IsActive: true
Text Renderer Component:
Text: Game Pause
Font: 176667660
IsActive: false
UI Component:
Canvas ID: 10
Hovered: false
Clicked: false
IsActive: true
Scripts: ~ Scripts: ~
- EID: 19 - EID: 19
Name: ====EnvironmentMaster==== Name: ====EnvironmentMaster====
@ -13334,3 +13428,11 @@
alphaValue: 1 alphaValue: 1
fadeInTime: 0.5 fadeInTime: 0.5
fadeOutTime: 0.5 fadeOutTime: 0.5
- EID: 172
Name: TweenManager
IsActive: true
NumberOfChildren: 0
Components: ~
Scripts:
- Type: SHADE_Scripting.UI.TweenManager
Enabled: true

View File

@ -352,23 +352,23 @@
Scripts: ~ Scripts: ~
- EID: 14 - EID: 14
Name: BackGround Name: BackGround
IsActive: true IsActive: false
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: 0.5} Translate: {x: 0, y: 0, z: 0.5}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1920, y: 1080, z: 1} Scale: {x: 1920, y: 1080, z: 1}
IsActive: true IsActive: false
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 121834459 Material: 121834459
IsActive: true IsActive: false
UI Component: UI Component:
Canvas ID: 13 Canvas ID: 13
Hovered: false Hovered: false
Clicked: false Clicked: false
IsActive: true IsActive: false
Scripts: ~ Scripts: ~
- EID: 15 - EID: 15
Name: Instruction Image Name: Instruction Image
@ -580,7 +580,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -150, y: 400, z: -0.5} Translate: {x: -150, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1} Scale: {x: 100, y: 100, z: 1}
IsActive: true IsActive: true
@ -600,7 +600,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -900, y: 300, z: -0.5} Translate: {x: -900, y: 300, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1} Scale: {x: 100, y: 100, z: 1}
IsActive: true IsActive: true
@ -636,7 +636,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: -0.5} Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -656,7 +656,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -100, z: -0.5} Translate: {x: 0, y: -100, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -676,7 +676,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -200, z: -0.5} Translate: {x: 0, y: -200, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -781,7 +781,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -900, y: -120, z: -0.5} Translate: {x: -900, y: -120, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1} Scale: {x: 100, y: 100, z: 1}
IsActive: true IsActive: true
@ -817,7 +817,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: -0.5} Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -837,7 +837,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -100, z: -0.5} Translate: {x: 0, y: -100, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -935,7 +935,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: 0} Translate: {x: 0, y: 0, z: 1}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -960,7 +960,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -100, z: 0.5} Translate: {x: 0, y: -100, z: 1}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -985,7 +985,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -200, z: 0.5} Translate: {x: 0, y: -200, z: 1}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -1026,7 +1026,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: 0} Translate: {x: 0, y: 0, z: 1}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -1051,7 +1051,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -100, z: 0.5} Translate: {x: 0, y: -100, z: 1}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
@ -1135,7 +1135,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -150, y: 400, z: -0.5} Translate: {x: -150, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1} Scale: {x: 100, y: 100, z: 1}
IsActive: true IsActive: true
@ -1214,7 +1214,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -150, y: 400, z: -0.5} Translate: {x: -150, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1} Scale: {x: 100, y: 100, z: 1}
IsActive: true IsActive: true

View File

@ -84,6 +84,8 @@ public class GameManager : Script
AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming"); AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming");
AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f); AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f);
AudioHandler.audioClipHandlers["SFXHumming"].Play(); AudioHandler.audioClipHandlers["SFXHumming"].Play();
SceneFadeInOut.Instance.CallFadeOut();
} }
protected override void update() protected override void update()

View File

@ -37,12 +37,13 @@ namespace SHADE_Scripting.UI
fadeR = GameObject.GetComponent<Renderable>(); fadeR = GameObject.GetComponent<Renderable>();
fadeR.Material.SetProperty<float>("data.alpha", alphaValue); fadeR.Material.SetProperty<float>("data.alpha", alphaValue);
GameObject.Parent.SetActive(false);
//alphaValue = fadeR.Material.GetProperty<float>("data.alpha"); //alphaValue = fadeR.Material.GetProperty<float>("data.alpha");
} }
protected override void start() protected override void start()
{ {
CallFadeOut();
} }
protected override void update() protected override void update()
@ -55,12 +56,17 @@ namespace SHADE_Scripting.UI
if (fadeInTime == 0.0f) if (fadeInTime == 0.0f)
{ {
alphaValue = 1.0f; alphaValue = 1.0f;
} }
else else
{ {
alphaValue += (1.0f / fadeInTime) * Time.DeltaTimeF; alphaValue += (1.0f / fadeInTime) * Time.DeltaTimeF;
} }
if (alphaValue >= 1.0f) alphaValue = 1.0f; if (alphaValue >= 1.0f)
{
alphaValue = 1.0f;
GameObject.Parent.SetActive(false);
}
} }
if (fadeOut) //fading out if (fadeOut) //fading out
@ -69,12 +75,17 @@ namespace SHADE_Scripting.UI
if (fadeOutTime == 0.0f) if (fadeOutTime == 0.0f)
{ {
alphaValue = 0.0f; alphaValue = 0.0f;
} }
else else
{ {
alphaValue -= (1.0f / fadeOutTime) * Time.DeltaTimeF; alphaValue -= (1.0f / fadeOutTime) * Time.DeltaTimeF;
} }
if (alphaValue <= 0.0f) alphaValue = 0.0f; if (alphaValue <= 0.0f)
{
alphaValue = 0.0f;
GameObject.Parent.SetActive(false);
}
} }
fadeR.Material.SetProperty<float>("data.alpha", alphaValue); fadeR.Material.SetProperty<float>("data.alpha", alphaValue);
@ -91,18 +102,21 @@ namespace SHADE_Scripting.UI
{ {
fadeIn = true; fadeIn = true;
fadeOut = false; fadeOut = false;
GameObject.Parent.SetActive(true);
} }
public void CallFadeOut() public void CallFadeOut()
{ {
fadeOut = true; fadeOut = true;
fadeIn = false; fadeIn = false;
GameObject.Parent.SetActive(true);
} }
public void CallFadeStop() public void CallFadeStop()
{ {
fadeOut = false; fadeOut = false;
fadeIn = false; fadeIn = false;
GameObject.Parent.SetActive(false);
} }
public bool FadeOutFinished() public bool FadeOutFinished()

View File

@ -16,8 +16,6 @@ namespace SHADE_Scripting.UI
private float value = 0.0f; private float value = 0.0f;
public float startValue = 0.0f; public float startValue = 0.0f;
public float endValue = 1.0f; public float endValue = 1.0f;
public TweenThread(float duration, float startValue, float endValue, EASING_METHOD method) public TweenThread(float duration, float startValue, float endValue, EASING_METHOD method)
{ {
this.duration = duration; this.duration = duration;
@ -25,7 +23,6 @@ namespace SHADE_Scripting.UI
this.startValue = startValue; this.startValue = startValue;
this.endValue = endValue; this.endValue = endValue;
} }
public void Update(float deltaTime) public void Update(float deltaTime)
{ {
if (timer >= duration) if (timer >= duration)
@ -37,12 +34,10 @@ namespace SHADE_Scripting.UI
value = EasingHelper.EaseHelp(timer/duration, method) * (endValue - startValue) + startValue ; value = EasingHelper.EaseHelp(timer/duration, method) * (endValue - startValue) + startValue ;
} }
public bool IsCompleted() public bool IsCompleted()
{ {
return timer >= duration; return timer >= duration;
} }
public void Reset() public void Reset()
{ {
timer = 0.0f; timer = 0.0f;
@ -61,15 +56,69 @@ namespace SHADE_Scripting.UI
startValue = endValue; startValue = endValue;
endValue = temp; endValue = temp;
} }
public float GetValue() public float GetValue()
{ {
return value; return value;
} }
} }
public class TweenThreadVec3
{
private float timer = 0.0f;
public float duration = 1.0f;
public EASING_METHOD method;
private Vector3 value = Vector3.Zero;
public Vector3 startValue = Vector3.Zero;
public Vector3 endValue = Vector3.Zero;
public TweenThreadVec3(float duration, Vector3 startValue, Vector3 endValue, EASING_METHOD method)
{
this.duration = duration;
this.method = method;
this.startValue = startValue;
this.endValue = endValue;
}
public void Update(float deltaTime)
{
if (timer >= duration)
return;
timer += deltaTime;
if (timer >= duration)
timer = duration;
value = (endValue - startValue) * EasingHelper.EaseHelp(timer / duration, method) + startValue;
}
public bool IsCompleted()
{
return timer >= duration;
}
public void Reset()
{
timer = 0.0f;
value = startValue;
}
public void Reset(Vector3 startValue, Vector3 endValue)
{
Reset();
this.startValue = startValue;
this.endValue = endValue;
}
public void ResetInvert()
{
Reset();
Vector3 temp = startValue;
startValue = endValue;
endValue = temp;
}
public Vector3 GetValue()
{
return value;
}
}
public class TweenManager : Script public class TweenManager : Script
{ {
public static TweenManager Instance { get; private set; } public static TweenManager Instance { get; private set; }
@ -77,6 +126,9 @@ namespace SHADE_Scripting.UI
[NonSerialized] [NonSerialized]
private List<TweenThread> threadList; private List<TweenThread> threadList;
[NonSerialized]
private List<TweenThreadVec3> threadVec3List;
protected override void awake() protected override void awake()
{ {
if (Instance != null && Instance != this) if (Instance != null && Instance != this)
@ -85,6 +137,7 @@ namespace SHADE_Scripting.UI
Instance = this; Instance = this;
threadList = new List<TweenThread>(); threadList = new List<TweenThread>();
threadVec3List = new List<TweenThreadVec3>();
} }
@ -101,6 +154,11 @@ namespace SHADE_Scripting.UI
{ {
thread.Update(Time.DeltaTimeF); thread.Update(Time.DeltaTimeF);
} }
foreach (TweenThreadVec3 thread in threadVec3List)
{
thread.Update(Time.DeltaTimeF);
}
} }
@ -116,5 +174,20 @@ namespace SHADE_Scripting.UI
return thread; return thread;
} }
public static TweenThreadVec3 CreateTweenThreadVec3(float duration, Vector3 startValue, Vector3 endValue, EASING_METHOD method)
{
if (Instance == null)
return null;
TweenThreadVec3 thread = new TweenThreadVec3(duration, startValue, endValue, method);
Instance.threadVec3List.Add(thread);
thread.Reset();
return thread;
}
} }
} }