46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using Kill.Network;
|
|
using Kill.Managers;
|
|
namespace Kill.UI.Pages
|
|
{
|
|
public class VideoUIItem : MonoBehaviour
|
|
{
|
|
public Text timeText;
|
|
public Image videoImage;
|
|
public Text data;
|
|
public void Init(DateTime time,string path="",float angle=0,float dis=0)
|
|
{
|
|
timeText.text = time.ToString("yyyy-MM-dd HH:mm:ss");
|
|
if(path!="")
|
|
{
|
|
videoImage.gameObject.SetActive(true);
|
|
GetComponent<Button>().interactable=true;
|
|
NetworkCtrl.Instance.LoadImageToUIImageAsync(path, videoImage);
|
|
data.text="";
|
|
}
|
|
else
|
|
{
|
|
int type=DataManager.Instance.userInfo.unit_system;
|
|
string disStr="";
|
|
if(type==0)
|
|
{
|
|
disStr=dis.ToString("f1")+"m";
|
|
}
|
|
else
|
|
{
|
|
int lensFt=Mathf.RoundToInt((float)(dis * 3.28084));
|
|
disStr=lensFt+"ft";
|
|
}
|
|
videoImage.gameObject.SetActive(false);
|
|
GetComponent<Button>().interactable=false;
|
|
data.text=$"{angle}° {disStr}";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|