-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Unity3D-sdk] Fix conflicts between different UnityNodes
This commit allows folders 'fairygui', 'ngui', 'ugui' and 'uguiWithTMPro' to exists in project simultaneously without any compile errors as long as they have all the required dependencies. User can choose preferred UnityNode to use manually or it may be resolved automatically. While it's difficult to imagine the situation where an end user want to keep multiple UnityNode scripts simultaneously, this improvement helps to develop sdk without deleting/restoring folders, and also, in perspective, separate code into different assemblies and packages for Unity 2019 and newer. Note: TextMeshPro related code was set under define UNITY_2018_1_OR_NEWER, because TextMeshPro supports Unity 2018.1 and newer. Keeping this code for older versions is bad, because it makes hard to test sdk for older versions of Unity without removing the folder. So this change actually changes nothing, only makes life easier.
- Loading branch information
1 parent
4a9e388
commit adf4922
Showing
15 changed files
with
128 additions
and
17 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
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,10 @@ | ||
using UnityEngine; | ||
|
||
namespace Poco | ||
{ | ||
public abstract class UnityNodeProvider: ScriptableObject | ||
{ | ||
public abstract AbstractNode CreateNode(GameObject gameObject); | ||
public abstract bool SetText(GameObject go, string textVal); | ||
} | ||
} |
Binary file not shown.
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 Poco.FairyGUI | ||
{ | ||
public class FairyGuiUnityNodeProvider : UnityNodeProvider | ||
{ | ||
public override AbstractNode CreateNode(GameObject gameObject) | ||
{ | ||
return new UnityNode(gameObject); | ||
} | ||
|
||
public override bool SetText(GameObject go, string textVal) | ||
{ | ||
return UnityNode.SetText(go, textVal); | ||
} | ||
} | ||
} |
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
Binary file not shown.
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 Poco.NGUI | ||
{ | ||
public class NGuiUnityNodeProvider : UnityNodeProvider | ||
{ | ||
public override AbstractNode CreateNode(GameObject gameObject) | ||
{ | ||
return new UnityNode(gameObject); | ||
} | ||
|
||
public override bool SetText(GameObject go, string textVal) | ||
{ | ||
return UnityNode.SetText(go, textVal); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
using UnityEngine; | ||
|
||
|
||
namespace Poco | ||
namespace Poco.NGUI | ||
{ | ||
public class UnityNode : AbstractNode | ||
{ | ||
|
Binary file not shown.
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 Poco.UGUI | ||
{ | ||
public class UGuiUnityNodeProvider : UnityNodeProvider | ||
{ | ||
public override AbstractNode CreateNode(GameObject gameObject) | ||
{ | ||
return new UnityNode(gameObject); | ||
} | ||
|
||
public override bool SetText(GameObject go, string textVal) | ||
{ | ||
return UnityNode.SetText(go, textVal); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
using TMPro; | ||
|
||
|
||
namespace Poco | ||
namespace Poco.UGUI | ||
{ | ||
public class UnityNode : AbstractNode | ||
{ | ||
|
Binary file not shown.
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 Poco.UGUIWithTMPro | ||
{ | ||
public class UGuiWithTMProUnityNodeProvider : UnityNodeProvider | ||
{ | ||
public override AbstractNode CreateNode(GameObject gameObject) | ||
{ | ||
return new UnityNode(gameObject); | ||
} | ||
|
||
public override bool SetText(GameObject go, string textVal) | ||
{ | ||
return UnityNode.SetText(go, textVal); | ||
} | ||
} | ||
} |
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