19 lines
450 B
C#
19 lines
450 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
//[ExecuteAlways]
|
|
public class VertexAttraction : MonoBehaviour
|
|
{
|
|
public Transform AttractPoint;
|
|
public Material mat;
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (mat != null && AttractPoint != null)
|
|
{
|
|
mat.SetVector("_AttractPoint", transform.InverseTransformPoint(AttractPoint.position));
|
|
}
|
|
}
|
|
}
|