// Called when "Orientate to nearest face" button is clicked private void OnClickMoveToNearestFace() { Vector3 position; DecalUtil.GetDirectionToNearestFace(m_ActualTarget, out position); m_ActualTarget.SetTransform(position, m_ActualTarget.transform.rotation, m_ActualTarget.transform.lossyScale); m_ActualTarget.SetData(m_ActualTarget.decalData); }
void Start() { Decal decal = DecalSystem.CreateDecalDirect(decalData); decal.SetTransform(location.position, location.rotation, Vector2.one); decal.SetData(decalData); decal.transform.localScale = Vector3.one; }