using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class MultiJoy : MonoBehaviour, IPointerDownHandler,
IPointerUpHandler, IDragHandler
{
public RectTransform pad;
public RectTransform stick;
public void OnDrag(PointerEventData eventData)
{
stick.positioin = eventData.position;
stick.plocalPosition =
Vector2.ClampMagnitude(eventData.position -
(Vector)pad.position, pad.rect.width * 0.5f);
}
public void OnPointerDown(PointerEventData eventData)
{
pad.position = eventData.position;
}
public void OnPointerUp(PointerEventData eventData)
{
stick.localPosition = Vector2.zero;
}
}
Error that it gives is:
Assets\MultiJoy1.cs(14,15): error CS1061: âRectTransformâ does not contain a definition for âpositioinâ and no accessible extension method âpositioinâ accepting a first argument of type âRectTransformâ could be found (are you missing a using directive or an assembly reference?)
Assets\MultiJoy1.cs(16,15): error CS1061: âRectTransformâ does not contain a definition for âplocalPositionâ and no accessible extension method âplocalPositionâ accepting a first argument of type âRectTransformâ could be found (are you missing a using directive or an assembly reference?)
Assets\MultiJoy1.cs(18,10): error CS0246: The type or namespace name âVectorâ could not be found (are you missing a using directive or an assembly reference?)