Unity 3D Simple Pop Up Text Tutorial

Advertisemen

Unity 3D Simple Pop Up Text Tutorial


































DIRECT DOWNLOAD HERE

















THIS IS BACKUP  IN TEXT FORM

1. Create New java and name it : PopUpText


2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-







//----------------------------------------------------------------------------------
// POP UP TEXT//----------------------------------------------------------------------------------

#pragma strict

var player: Transform;
var showOnDistance: float = 2;
private var textMesh: MeshRenderer;

//----------------------------------------------------------------------------------
function Start ()
{
  textMesh = gameObject.GetComponent(MeshRenderer);
}

//----------------------------------------------------------------------------------
function Update ()
{

  if (Vector3.Distance(transform.position, player.position) < showOnDistance)
    textMesh.enabled = true;
    else
     textMesh.enabled = false;

}

//----------------------------------------------------------------------------------

















 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-























Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D