public override void Excuse() { PlayEffctAtom data = AtomData as PlayEffctAtom; //Actor attacker = ActorMgr.Instance.GetActor(OwnerStageEntity.Attacker); //if (data == null || OwnerStageEntity == null || attacker == null || OwnerEntity == null) //{ // return; //} //if (data.TargetType == eTargetType.TargetType_Self) //{ // OnPlayEffect(attacker, attacker); //} //else //{ // foreach (ulong id in OwnerStageEntity.Targeters) // { // Actor act = ActorMgr.Instance.GetActor(id); // if (act == null) // { // continue; // } // OnPlayEffect(attacker, act); // } //} }
void ShowGridMenu() { if (showMenu) { showMenu = false; if (selectedAtom == null) { GenericMenu.MenuFunction2 Selected = delegate(System.Object obj) { if (obj as String == "paste") { AddSkillAtom(cacheAtom); } else { Type tp = obj as Type; if (tp == null) { return; } MetaAtom atom = Activator.CreateInstance(tp) as MetaAtom; atom.Owner = _curMetaStage != null ? _curMetaStage.Owner : null; if (atom is PlayEffctAtom) { PlayEffctAtom ea = atom as PlayEffctAtom; ea.FlagIndex = atom.Owner != null?atom.Owner.GetFlagIndex() : 0; } else if (atom is PlaySoundAtom) { PlaySoundAtom sa = atom as PlaySoundAtom; sa.FlagIndex = atom.Owner != null?atom.Owner.GetFlagIndex() : 0; } AddSkillAtom(atom); } }; GenericMenu menu = new GenericMenu(); var scriptInfos = Utility.GetAllScriptsOfTypeCategorized(typeof(MetaAtom)); foreach (Utility.ScriptInfo script in scriptInfos) { if (string.IsNullOrEmpty(script.category)) { menu.AddItem(new GUIContent(script.name), false, Selected, script.type); } } foreach (Utility.ScriptInfo script in scriptInfos) { if (!string.IsNullOrEmpty(script.category)) { menu.AddItem(new GUIContent(script.category + "/" + script.name), false, Selected, script.type); } } menu.AddSeparator("/"); menu.AddItem(new GUIContent("粘贴"), false, Selected, "paste"); menu.ShowAsContext(); } else { GenericMenu.MenuFunction2 Selected = delegate(object selectedType) { if (selectedType.ToString() == "delete") { RemoveSkillAtom(selectedAtom); } else if (selectedType.ToString() == "copy") { CopySkillAtom(selectedAtom); } }; GenericMenu menu = new GenericMenu(); menu.AddItem(new GUIContent("删除"), false, Selected, "delete"); menu.AddItem(new GUIContent("复制"), false, Selected, "copy"); menu.ShowAsContext(); } Event.current.Use(); } }