Skip to content

Instantly share code, notes, and snippets.

@karl-
Created January 24, 2019 20:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save karl-/d809129527521dab657559bcd2e76150 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.ProBuilder;
namespace PipeDreams
{
public class PipeManager : MonoBehaviour
{
public float extrudeSpeed = 1f;
public float minExtrudeDistance = 2f;
public float maxExtrudeDistance = 20f;
static List<Pipe> s_Pipes = new List<Pipe>();
void Start()
{
ProBuilderMesh mesh = ShapeGenerator.CreateShape(ShapeType.Cube);
Pipe pipe = mesh.gameObject.AddComponent<Pipe>();
s_Pipes.Add(pipe);
pipe.Begin(extrudeSpeed, minExtrudeDistance, maxExtrudeDistance);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment