public void addCameraDolly() { if (dollyRail == null) { GameObject go = new GameObject("Dolly"); Dc2dDolly dolly = go.AddComponent <Dc2dDolly>(); Dc2dWaypoint wp1 = new Dc2dWaypoint(); wp1.position = new Vector3(0, 0, 0); Dc2dWaypoint wp2 = new Dc2dWaypoint(); wp2.position = new Vector3(1, 0, 0); Dc2dWaypoint[] dc2dwaypoints = new Dc2dWaypoint[2]; dc2dwaypoints[0] = wp1; dc2dwaypoints[1] = wp2; wp1.endPosition = wp2.position; dolly.allWaypoints = dc2dwaypoints; this.dollyRail = dolly; /*Selection.activeGameObject = go; * SceneView.FrameLastActiveSceneView();*/ } }
private void OnEnable() { dolly = (Dc2dDolly)target; }