Używanie TreeEditor poza edytorem 3412 0

O temacie

Autor carelion

Zaczęty 31.05.2015 roku

Wyświetleń 3412

Odpowiedzi 0

carelion

carelion

RaveN Studio
Moete Kita Zo!
posty153
Propsy73
Profesjabrak
  • RaveN Studio
  • Moete Kita Zo!
Witam, stworzyłem sobię skrypt dzięki któremu model się deformuje:
using UnityEngine;
using System.Collections;
using TreeEditor;

public class Noise : MonoBehaviour {

public float scale = 1.0f;
public float speed = 1.0f;
private GameObject obj;

private Vector3[] baseVertices;
private Perlin noise;
void Start()
{
noise = new Perlin();
}

void Update()
{
Mesh mesh = GetComponent<MeshFilter>().mesh;

if (baseVertices == null)
baseVertices = mesh.vertices;

Vector3[] vertices = new Vector3[baseVertices.Length];

float time = Time.time * speed;

for(var i=0;i<vertices.Length;i++)
{
var vertex = baseVertices[i];
vertex.x += noise.Noise(time + vertex.x, time + vertex.x, time + vertex.x) * scale;
vertex.z += noise.Noise(time + vertex.z, time + vertex.z, time + vertex.z) * scale;
vertices[i] = vertex;
}
mesh.vertices = vertices;
}
}

Wszystko działa dobrze, jednak przy próbie budowania projektu wyskakuje komunikat o treści:
error CS0246: The type or namespace name `TreeEditor' could not be found. Are you missing a using directive or an assembly reference?Z tego co wyczytałem w internecie 'TreeEditor' jest dostępne tylko z poziomu edytora, ale czy da się użyć klasy Perlin itp. w grze? A jeśli tak to jak?
 


0 użytkowników i 1 Gość przegląda ten wątek.
0 użytkowników
Do góry