public void AddPatternPreset() { if (Frame.select == null) { PopupWindow.instance.Active("Frame is null", Color.white); return; } PatternFrameInfo.Preset pre = new PatternFrameInfo.Preset(); patternDatabase.AddPatternPreset(patternList.value, Frame.select.frame, pre); CreateMarker(pre, Frame.select); Frame.select.MarkerActive(); Frame.select.SetSprite(frameSprite[1]); }
public void CreateMarker(PatternFrameInfo.Preset info, Frame f) { DirectionMarker marker = Instantiate(markerBase).GetComponent <DirectionMarker>(); f.markers.Add(marker); marker.transform.SetParent(this.transform); marker.info = info; for (int i = 0; i < presetDatabase.data[info.preset].shots.Count; ++i) { Transform tp = Instantiate(spikeMarkerBase).transform; tp.SetParent(marker.transform); tp.rotation = Quaternion.Euler(0f, 0f, presetDatabase.data[info.preset].shots[i].angle); } marker.transform.rotation = Quaternion.Euler(0f, 0f, info.extraAngle); marker.gameObject.SetActive(false); }
public void AddPatternPreset(int dataIndex, int frameIndex, PatternFrameInfo.Preset preset) { if (!ExistsCheck(dataIndex)) { PopupWindow.instance.Active("Pattern does not Exists", Color.white); return; } PatternFrameInfo info = FindFrame(dataIndex, frameIndex); if (info == null) { info = AddFrame(dataIndex, frameIndex); info.presets.Add(preset); } else { info.presets.Add(preset); } }