Skip to content

Commit

Permalink
add: release v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoraizQ committed Jul 8, 2020
1 parent 2c77cc7 commit 79e91cc
Show file tree
Hide file tree
Showing 66 changed files with 1,250 additions and 306 deletions.
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
//================================================================================================================================
//
// Copyright (c) 2015-2020 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved.
// EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China
// and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd.
//
//================================================================================================================================

using System;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;

namespace ImageTracking_Video
{
public class ImageTargetVideoSample : MonoBehaviour
{
public Text UIText;

private List<VideoPlayer> players;

private void Awake()
{
players = FindObjectsOfType<VideoPlayer>().Where(p => p.renderMode == VideoRenderMode.RenderTexture).ToList();
}

private void Update()
{
UIText.text = "Video AspectRatio:" + Environment.NewLine;
foreach (var p in players)
{
UIText.text += "\t" + p.name + ": " + p.aspectRatio + Environment.NewLine;
}
}

public void ChangeVideoAspectRatio()
{
foreach (var p in players)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public class VideoPlayerAgent : MonoBehaviour
private ImageTargetController controller;
private MeshRenderer meshRenderer;
public UnityEngine.Video.VideoPlayer player;
public GameObject textDisplay;
public float visibility = 0.5f;
private int visIndex = 0;
public float[ ] visibilityOptions = new float[ ]{0.75f, 0.5f, 0.25f, 0.1f, 0.05f} ;

private bool ready = true;
private bool prepared;
private bool found;
Expand Down Expand Up @@ -66,5 +71,19 @@ private void StatusChanged()
player.Pause();
}
}


public void changeVisibility()
{
if (visIndex == visibilityOptions.Length) {
visIndex = 0;
}

visibility = visibilityOptions[visIndex];
visIndex += 1;

textDisplay.GetComponent<UnityEngine.UI.Text>().text = "Visibility: " + visibility.ToString();
meshRenderer.material.color = new Color(1.0f,1.0f,1.0f, visibility);
}
}
}
Loading

0 comments on commit 79e91cc

Please sign in to comment.