AR加对战整体处理
This commit is contained in:
1 parent
9b1bb3d9ba
commit
fc7ef017d0
12 files changed
+40257
-40265
No files matched your search
@@ -22,6 +22,7 @@ public class Davinci : MonoBehaviour
|
||||
private bool enableLog = false;
|
||||
private float fadeTime = 1;
|
||||
private bool cached = true;
|
||||
private bool duplicate = false;
|
||||
|
||||
private enum RendererType
|
||||
{
|
||||
@@ -102,6 +103,7 @@ public class Davinci : MonoBehaviour
|
||||
if (enableLog)
|
||||
Debug.Log("[Davinci] Target as UIImage set : " + image);
|
||||
|
||||
duplicate = image.mainTexture.name.Equals(url);
|
||||
rendererType = RendererType.uiImage;
|
||||
this.targetObj = image.gameObject;
|
||||
return this;
|
||||
@@ -253,7 +255,11 @@ public class Davinci : MonoBehaviour
|
||||
error("Url has not been set. Use 'load' funtion to set image url.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (duplicate)
|
||||
{
|
||||
Debug.Log("[Davinci] Start Duplicate.");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(url);
|
||||
@@ -452,6 +458,7 @@ public class Davinci : MonoBehaviour
|
||||
{
|
||||
image = targetObj.GetComponent<RawImage>();
|
||||
targetObj.GetComponent<RawImage>().texture = texture;
|
||||
texture.name = url;
|
||||
}
|
||||
else if (targetObj.GetComponent<Image>())
|
||||
{
|
||||
@@ -459,6 +466,7 @@ public class Davinci : MonoBehaviour
|
||||
Sprite sprite = Sprite.Create(texture,
|
||||
new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||
targetObj.GetComponent<Image>().sprite = sprite;
|
||||
sprite.texture.name = url;
|
||||
}
|
||||
|
||||
if (image == null)
|
||||
|
||||
Reference in new issue
Block a user