public void RemoveSkillAtom(MetaAtom metaAtom) { if (_curMetaStage == null) { return; } MetaFrame frame = null; foreach (MetaFrame frm in _curMetaStage.FrameList) { if (!frm.MetaAtomList.Contains(metaAtom)) { continue; } frame = frm; } if (frame == null) { return; } frame.MetaAtomList.Remove(metaAtom); if (frame.MetaAtomList.Count == 0) { _curMetaStage.FrameList.Remove(frame); } selectedAtom = null; }
public void AddSkillAtom(MetaAtom metaAtom) { if (_curMetaStage == null) { return; } if (metaAtom == null) { return; } if (rClickInfo.y >= 0) { metaAtom.Index = (int)rClickInfo.y; } MetaFrame frame = null; foreach (MetaFrame frm in _curMetaStage.FrameList) { if (frm.Index != (int)rClickInfo.x) { continue; } frame = frm; } if (frame == null) { frame = new MetaFrame(); frame.Index = (int)rClickInfo.x; _curMetaStage.FrameList.Add(frame); _curMetaStage.FrameList = _curMetaStage.FrameList.OrderBy(frm => frm.Index).ToList(); } frame.MetaAtomList.Add(metaAtom); selectedAtom = metaAtom; }
public void ChangeKey(Vector2 srcKey, Vector2 dstKey) { if (_curMetaStage == null) { return; } MetaFrame srcFrameInfo = GetFrameInfo((int)srcKey.x); MetaFrame dstFrameInfo = GetFrameInfo((int)dstKey.x); if (srcFrameInfo == null) { return; } if (dstFrameInfo == null) { // 如果目标帧不存在 dstFrameInfo = new MetaFrame(); dstFrameInfo.Index = (int)dstKey.x; _curMetaStage.FrameList.Add(dstFrameInfo); } selectedAtom.Index = (int)dstKey.y; srcFrameInfo.MetaAtomList.Remove(selectedAtom); dstFrameInfo.MetaAtomList.Add(selectedAtom); if (srcFrameInfo.MetaAtomList.Count == 0) { _curMetaStage.FrameList.Remove(srcFrameInfo); } }
public MetaStage Clone() { MetaStage skillStage = new MetaStage(); foreach (MetaFrame sfi in this.FrameList) { MetaFrame newsfi = new MetaFrame(); newsfi.Index = sfi.Index; newsfi.MetaAtomList = new List <MetaAtom>(); foreach (MetaAtom sa in sfi.MetaAtomList) { MetaAtom newsa = null; if (sa != null) { newsa = sa.Clone(); } newsfi.MetaAtomList.Add(newsa); } skillStage.FrameList.Add(newsfi); } return(skillStage); }
// Update is called once per frame public void Update() { if (CurrentStage != StageState.Play) { return; } if (_curIndex >= StageData.FrameList.Count) { Stop(); return; } float fRate = 1.0f; MetaFrame frameInfo = StageData.FrameList [_curIndex]; if (_elapseTime * fRate >= frameInfo.Index * 0.01f) { foreach (MetaAtom atom in frameInfo.MetaAtomList) { if (atom != null) { ActionAtom action = atom.CreateAction(); if (action == null) { continue; } action.OwnerEntity = OwnerEntity; action.OwnerStageEntity = this; action.AtomData = atom; action.Excuse(); } } ++_curIndex; } _elapseTime += Time.deltaTime; }