unity public Image code example
Example 1: public image unity
using UnityEngine; using System.Collections; using UnityEngine.UI; public class Radar : MonoBehaviour { public Image Arrow; void OnTriggerEnter( Collider other) { if (other.gameObject.tag == "Enemy") Arrow.gameObject.SetActive(true); } }
Example 2: how to store a image in a varible unity
public Sprite Image;