// Update is called once per frame void Update() { if (this.transform.hasChanged) { this.transform.hasChanged = false; if (pointToCinemachinePath == null) { pointToCinemachinePath = this.GetComponentInParent <PointToCinemachinePath>(); } if (pointToCinemachinePath != null) { pointToCinemachinePath.UpdatePath(); } } }
public override void OnInspectorGUI() { DrawDefaultInspector(); PointToCinemachinePath _me = (PointToCinemachinePath)target; if (GUILayout.Button("Add Point")) { _me.AddProtPt(); } GUI.enabled = !_me.IsUseAutoUpdate(); if (GUILayout.Button("Update Path")) { _me.CreatePath(); } }