public MegaPathTarget AddTarget(MegaShape shape, int curve, float weight) { MegaPathTarget target = new MegaPathTarget(); target.shape = shape; target.Weight = weight; target.curve = curve; target.modifier = 1.0f; target.offset = 0.0f; Targets.Add(target); return(target); }
public MegaPathTarget AddTarget(MegaShape shape, int curve, float weight) { MegaPathTarget target = new MegaPathTarget(); target.shape = shape; target.Weight = weight; target.curve = curve; target.modifier = 1.0f; target.offset = 0.0f; Targets.Add(target); return target; }
void SwitchTarget() { // Alphaがほぼ最大まで達したとき if (msf.Alpha > 0.9989f) { ElaspedJunctionWaitTime += 1 * Time.deltaTime; // その場で停止し、指定時間が過ぎたら if (ElaspedJunctionWaitTime > JunctionWaitTime) { msf.speed = SwitchedSpeed; // ターゲットLineShapeを変更 target = msf.Targets[0]; target.shape = Jmsl; // 分岐完了フラグをON switched = true; msf.Alpha = 0; } } }
public void DisplayGUI() { MegaShapeFollow sf = (MegaShapeFollow)target; sf.mode = (MegaFollowMode)EditorGUILayout.EnumPopup("Mode", sf.mode); if (sf.mode == MegaFollowMode.Alpha) { sf.Alpha = EditorGUILayout.Slider("Alpha", sf.Alpha, -1.0f, 2.0f); } else { sf.distance = EditorGUILayout.FloatField("Distance", sf.distance); } //sf.Alpha = EditorGUILayout.Slider("Alpha", sf.Alpha, -1.0f, 2.0f); sf.tangentDist = EditorGUILayout.FloatField("Tangent", sf.tangentDist); sf.speed = EditorGUILayout.FloatField("Speed", sf.speed); sf.rot = EditorGUILayout.Toggle("Rot", sf.rot); sf.offset = EditorGUILayout.Vector3Field("Offset", sf.offset); sf.rotate = EditorGUILayout.Vector3Field("Rotate", sf.rotate); sf.time = EditorGUILayout.FloatField("Loop Time", sf.time); sf.ctime = EditorGUILayout.FloatField("Current Time", sf.ctime); sf.loopmode = (MegaRepeatMode)EditorGUILayout.EnumPopup("Loop Mode", sf.loopmode); sf.drawpath = EditorGUILayout.Toggle("Draw Path", sf.drawpath); if (sf.drawpath) { sf.gizmodetail = EditorGUILayout.FloatField("Gizmo Detail", sf.gizmodetail); sf.gizmodetail = Mathf.Clamp(sf.gizmodetail, 10.0f, 200.0f); } sf.lateupdate = EditorGUILayout.Toggle("Late Update", sf.lateupdate); if (sf.Targets.Count < 1) { if (GUILayout.Button("Add")) { MegaPathTarget pth = new MegaPathTarget(); sf.Targets.Add(pth); } } for (int i = 0; i < sf.Targets.Count; i++) { MegaPathTarget trg = sf.Targets[i]; EditorGUILayout.BeginVertical("Box"); trg.shape = (MegaShape)EditorGUILayout.ObjectField("Target", trg.shape, typeof(MegaShape), true); if (trg.shape && trg.shape.splines != null && trg.shape.splines.Count > 1) { trg.curve = EditorGUILayout.IntSlider(MegaToolTip.Curve, trg.curve, 0, trg.shape.splines.Count - 1); } trg.Weight = EditorGUILayout.Slider("Weight", trg.Weight, -1.0f, 1.0f); trg.offset = EditorGUILayout.Slider("Offset", trg.offset, -1.0f, 1.0f); trg.modifier = EditorGUILayout.FloatField("Modifier", trg.modifier); EditorGUILayout.EndVertical(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Add")) { MegaPathTarget pth = new MegaPathTarget(); sf.Targets.Add(pth); } if (GUILayout.Button("Delete")) { sf.Targets.Remove(trg); } EditorGUILayout.EndHorizontal(); } }
public void DisplayGUI() { MegaShapeFollow sf = (MegaShapeFollow)target; sf.mode = (MegaFollowMode)EditorGUILayout.EnumPopup("Mode", sf.mode); if ( sf.mode == MegaFollowMode.Alpha ) sf.Alpha = EditorGUILayout.Slider("Alpha", sf.Alpha, -1.0f, 2.0f); else sf.distance = EditorGUILayout.FloatField("Distance", sf.distance); //sf.Alpha = EditorGUILayout.Slider("Alpha", sf.Alpha, -1.0f, 2.0f); sf.tangentDist = EditorGUILayout.FloatField("Tangent", sf.tangentDist); sf.speed = EditorGUILayout.FloatField("Speed", sf.speed); sf.rot = EditorGUILayout.Toggle("Rot", sf.rot); sf.offset = EditorGUILayout.Vector3Field("Offset", sf.offset); sf.rotate = EditorGUILayout.Vector3Field("Rotate", sf.rotate); sf.time = EditorGUILayout.FloatField("Loop Time", sf.time); sf.ctime = EditorGUILayout.FloatField("Current Time", sf.ctime); sf.loopmode = (MegaRepeatMode)EditorGUILayout.EnumPopup("Loop Mode", sf.loopmode); sf.drawpath = EditorGUILayout.Toggle("Draw Path", sf.drawpath); if ( sf.drawpath ) { sf.gizmodetail = EditorGUILayout.FloatField("Gizmo Detail", sf.gizmodetail); sf.gizmodetail = Mathf.Clamp(sf.gizmodetail, 10.0f, 200.0f); } sf.lateupdate = EditorGUILayout.Toggle("Late Update", sf.lateupdate); if ( sf.Targets.Count < 1 ) { if ( GUILayout.Button("Add") ) { MegaPathTarget pth = new MegaPathTarget(); sf.Targets.Add(pth); } } for ( int i = 0; i < sf.Targets.Count; i++ ) { MegaPathTarget trg = sf.Targets[i]; EditorGUILayout.BeginVertical("Box"); trg.shape = (MegaShape)EditorGUILayout.ObjectField("Target", trg.shape, typeof(MegaShape), true); if ( trg.shape && trg.shape.splines != null && trg.shape.splines.Count > 1 ) trg.curve = EditorGUILayout.IntSlider(MegaToolTip.Curve, trg.curve, 0, trg.shape.splines.Count - 1); trg.Weight = EditorGUILayout.Slider("Weight", trg.Weight, -1.0f, 1.0f); trg.offset = EditorGUILayout.Slider("Offset", trg.offset, -1.0f, 1.0f); trg.modifier = EditorGUILayout.FloatField("Modifier", trg.modifier); EditorGUILayout.EndVertical(); EditorGUILayout.BeginHorizontal(); if ( GUILayout.Button("Add") ) { MegaPathTarget pth = new MegaPathTarget(); sf.Targets.Add(pth); } if ( GUILayout.Button("Delete") ) { sf.Targets.Remove(trg); } EditorGUILayout.EndHorizontal(); } }
public void DeleteTarget(MegaPathTarget target) { Targets.Remove(target); }
public void DeleteTarget(MegaPathTarget target) { Targets.Remove(target); }