Skip to content

Commit 8680709

Browse files
committed
add macro define for free version.
1 parent fe3c844 commit 8680709

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Assets/JCSUnity/Scripts/GUI/JCS_GUILiquidBar.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace JCSUnity
1515
{
16-
1716
/// <summary>
1817
/// GUI liquid bar like health bar, mana bar etc.
1918
/// Is specific for Unity Engine's Canvas system.

Assets/JCSUnity/Scripts/GameObject/3D/JCS_3DLiquidBar.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
* $Notice: See LICENSE.txt for modification and distribution information
77
* Copyright (c) 2016 by Shen, Jen-Chieh $
88
*/
9+
10+
/*
11+
* If you had purchase a copy of 'SpriteMask' and willing to use this
12+
* component, uncomment a line below.
13+
*
14+
* SpriteMask: https://assetstore.unity.com/packages/tools/sprite-management/sprite-mask-27642
15+
*/
16+
//#define SPRITE_MASK
17+
918
using UnityEngine;
1019
using System.Collections;
1120

1221

1322
namespace JCSUnity
1423
{
15-
1624
/// <summary>
1725
/// if finding for 2D Liquid bar to do the health bar effect,
1826
/// plz use the "JCS_GUILiquidBar" instead.
@@ -34,11 +42,13 @@ public class JCS_3DLiquidBar
3442
private Vector3 mMaskTargetPosition = Vector3.zero;
3543

3644

45+
#if (SPRITE_MASK)
3746
[Header("** Initilaize Variables (JCS_3DLiquidBar) **")]
3847

3948
[Tooltip("Plz set this.")]
4049
[SerializeField]
4150
private SpriteMask mSpriteMask = null;
51+
#endif
4252

4353
[Tooltip("Plz put the under texture bar here.")]
4454
[SerializeField]
@@ -297,6 +307,7 @@ private void GetContainerData()
297307
if (mBarSpriteRenderer == null)
298308
return;
299309

310+
#if (SPRITE_MASK)
300311
// find the width and height of the image from sprite renderer
301312
Vector2 maskSize = mSpriteMask.size;
302313

@@ -330,6 +341,7 @@ private void GetContainerData()
330341
}
331342
break;
332343
}
344+
#endif
333345

334346
// do starting percent
335347
FixPercentage();
@@ -374,8 +386,10 @@ private void FixPercentage()
374386
/// </summary>
375387
private void TowardToTargetValue()
376388
{
389+
#if (SPRITE_MASK)
377390
Vector3 speed = (mMaskTargetPosition - mSpriteMask.transform.localPosition) / mDeltaFriction * Time.deltaTime;
378391
mSpriteMask.transform.localPosition += speed;
392+
#endif
379393
}
380394

381395
/// <summary>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Build from DESKTOP-5QUO247 at 11/12/2017 4:22:13 PM
1+
Build from DESKTOP-5QUO247 at 11/13/2017 11:23:07 AM

0 commit comments

Comments
 (0)