unity netcode tutorial code example
Example 1: unity onpointerdown
using UnityEngine;
using UnityEngine.EventSystems;
public class Example : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public void OnPointerDown(PointerEventData pointerEventData)
{
Debug.Log(name + "Game Object Click in Progress");
}
public void OnPointerUp(PointerEventData pointerEventData)
{
Debug.Log(name + "No longer being clicked");
}
}
Example 2: unity pingpong
void Update()
{
transform.position = new Vector3(Mathf.PingPong(Time.time, 3), transform.position.y, transform.position.z);
}