Esempio n. 1
0
		public void BuildSpline () {
			Vector3 Q0 = this.transform.position;
			Vector3 Q1 = this.end.transform.position;
			Vector3 T0 = this.transform.forward * zeroSpeed;
			Vector3 T1 = - this.end.transform.forward * zeroSpeed;

			this.a = Q0;
			this.b = T0;
			this.c = 3f * (Q1 - Q0) - (2f * T0 + T1);
			this.d = (T1 - T0) / 3f - 2f / 3f * this.c;

			this.end.end = this;
		}
Esempio n. 2
0
		public void DestroyPath () {
			this.CMeshCollider.sharedMesh = null;
			this.CMeshFilter.sharedMesh = this.PrimitiveSphere;

			if (this.end != null) {
				this.end.CMeshCollider.sharedMesh = null;
				this.end.CMeshFilter.sharedMesh = this.PrimitiveSphere;
				this.end.end = null;
			}

			this.end = null;
		}