public void SetPolicy(string policyAction, ApiCondition condition, string policyComment, EffectType policyEffect, string policyPrincipal, string policyResource) { thisPermission = new PermissionStatement { Action = policyAction, ApiConditions = condition, Comment = policyComment, Effect = policyEffect, Principal = policyPrincipal, Resource = policyResource }; Action = PlayerController.GetPolicyAction(policyAction); ApiConditions = condition; Comment = policyComment; Effect = policyEffect; Principal = policyPrincipal; Resource = policyResource; commentText.text = $"<i>{policyComment}</i>"; resourceText.text = $"<b>Resource</b>\n\"{policyResource}\""; actionText.text = "<b>Action</b>\n" + policyAction; principalText.text = "<b>Principal</b>\n" + policyPrincipal; effectText.text = "<b>Effect</b>\n" + policyEffect.ToString(); }
public string GetLocalizationText_EffectType_Aura(EffectType effectType, float value, float duration, float auraEffectiveness, float selfAuraEffectiveness) { commonLocalizationData.TryGetValue("effectType.bonusProp." + effectType.ToString(), out string s); switch (effectType) { case EffectType.BODYGUARD_AURA: s = string.Format(s, Math.Min(BodyguardAura.BASE_DAMAGE_TRANSFER * auraEffectiveness, 1f) * 100, ((BodyguardAura.BASE_DAMAGE_MITIGATION + (BodyguardAura.DAMAGE_MITIGATION_GROWTH * value)) * auraEffectiveness) * 100); break; case EffectType.CLEAR_STATUSES: break; case EffectType.MASS_SHIELD_AURA: s = string.Format(s, Math.Min(MassShieldAura.BASE_DAMAGE_TRANSFER * auraEffectiveness, 1f) * 100, ((MassShieldAura.BASE_DAMAGE_MITIGATION + (MassShieldAura.DAMAGE_MITIGATION_GROWTH * value)) * auraEffectiveness) * 100); break; default: break; } s += '\n'; return(s); }
//---------------------------------------------------------------------- // Pick() -- this takes an element description and returns a copy with // its min-max range converted to an actual; nothing big here //---------------------------------------------------------------------- public ArrayList Pick() { ArrayList pickedElements = new ArrayList(); //----------------------------------------------------------------- // for elements that may not be present (indicated by a p value), // then we check p, not on a per-n basis, but rather for the whole // set: //----------------------------------------------------------------- if (Utility.RandomDouble() > Probability) { return(pickedElements); // empty list okay } int n = Utility.RandomMinMax(m_Min, m_Max); string[] picks = m_PickFrom.Split(new Char [] { ',' }); string pick = ""; for (int i = 0; i < n; i++) { if (picks.Length == 1) { pick = picks[0]; } else if (picks.Length >= 2) { pick = picks[Utility.RandomMinMax(0, picks.Length - 1)]; } EncounterElement pickedElement = new EncounterElement( m_XmlNode, "1", pick, m_ID.ToString(), m_Min.ToString(), m_Max.ToString(), m_ForceAttack.ToString(), m_Effect.ToString(), m_EffectHue.ToString() ); pickedElement.m_N = n; foreach (EncounterElement childElement in m_Elements) { ArrayList pickedChildElements = childElement.Pick(); foreach (EncounterElement pickedChildElement in pickedChildElements) { pickedElement.m_Elements.Add(pickedChildElement); } } pickedElements.Add(pickedElement); } return(pickedElements); // empty list okay }
public void OnClick() { if (EagleEyes.Instance.UIBlocked("MySelectedSkillButton", type.ToString())) { return; } SetSkill(true); }
public static void Load() { for (int i = 0; i < 5; i++) { EffectType s = (EffectType)i; Data.Add(s, Global.gContent.Load <SoundEffect>(@"Sound\" + s.ToString())); } }
void onUpgrade(EffectType type, int ID) { // Debug.Log("received upgrade event " + type + "\n"); if (text.Equals("") || type.ToString().Equals(text)) { selected = true; } }
/// <summary> /// エフェクトを再生する /// </summary> /// <param name="parent"></param> /// <param name="effectType"></param> public static void FireEffect(Vector3 position, EffectType effectType) { var prefabPath = "Effects/" + effectType.ToString(); var prefab = Resources.Load <GameObject>(prefabPath); var go = GameObject.Instantiate(prefab, position, Quaternion.identity); go.transform.localScale = Vector3.one; }
public void execute(CreatureBattleStatusController attacker, CreatureBattleStatusController defender, float damageModifier, bool MakesContact) { user = attacker; target = defender; this.damageModifier = damageModifier; this.MakesContact = MakesContact; GetType().GetMethod("" + effectType.ToString()).Invoke(this, null); }
void OnLavaBurn(EffectType type) { // Debug.Log("saw a lava event\n"); if (type.ToString().Equals(text)) { // Debug.Log("need " + text + " have " + type.ToString() + "\n"); selected = true; Lava.OnLavaBurn -= OnLavaBurn; } }
public void Save(SaveData data) { data.Add("effectName", effectName); data.Add("remainingTime", remainingTime); data.Add("movementMultiplier", movementMultiplier); data.Add("style", style.ToString()); data.Add("type", type.ToString()); }
public string GetGeneRegion() { EffectType eff = EffectTypeMethods.GetGeneRegion(GetEffectType()); if (eff == EffectType.TRANSCRIPT && EffectTypeMethods.IsExon(Marker, EffectTypes)) { eff = EffectType.EXON; } return(eff.ToString()); }
private static GameObject Load(EffectType etype) { GameObject model = Resources.Load <GameObject>(path + etype.ToString()); GameObject e = GameObject.Instantiate <GameObject>(model); e.transform.SetParent(GetParent().transform); e.transform.localPosition = Vector3.zero; e.transform.localScale = Vector3.one; model = null; return(e); }
void CheckIfImmune() { if (typeOfEffect.ToString().Contains("Immune")) { immuneEffect = true; } else { immuneEffect = false; } }
public static string CalcUniqueId(EffectType type, Tile source) { var id = type.ToString(); if (source != null) { id += "_" + source.tag1; } return(id); }
public void Save(SaveData data) { data.Add("name", name); data.Add("remainingTime", remainingTime); data.Add("tickTime", tickTime); data.Add("minTickDamages", minTickDamages); data.Add("maxTickDamages", maxTickDamages); data.Add("type", type.ToString()); }
public void onUpgrade(EffectType type, int ID) { if (!Ok()) { return; } if (type.ToString().Equals(text)) { // Debug.Log("RewardTrigger onUpgrade " + type + "\n"); my_reward.current_number++; } }
public void OnDrawMoreInfo(SerializedProperty property, Rect position) { #region Every var index = 0; GUIStyle style = new GUIStyle() { fontSize = 20, alignment = TextAnchor.MiddleCenter, }; EditorGUI.LabelField(position.GetRectFromIndexWithHeight(ref index, 20 + 5), "详细信息", style); EditorGUI.LabelField(position.GetRectAtIndex(index++), "类型", type.ToString()); #endregion switch (type) { case EffectType.Animation: EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("causeDamage")); EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("clip")); EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("animationPrefab")); EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("localPosition")); EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("localScale")); break; case EffectType.Audio: var audioNameProp = property.FindPropertyRelative("audioName"); //TODO:AUDIOpath // InitSerializedStringArray(audioNameProp.FindPropertyRelative("values"), typeof(AudioPath)); EditorGUI.PropertyField(position.GetRectAtIndex(index++), audioNameProp); break; case EffectType.Shining: EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("shiningColor")); EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("shiningDuring")); break; case EffectType.Partical: EditorGUI.PropertyField(position.GetRectAtIndex(index++), property.FindPropertyRelative("particalPrefab")); break; } }
public static ParticleEffectPool GetPool(EffectType type) { ParticleEffectPool output; if (map.TryGetValue(type, out output)) { return(output); } else { throw new UnityException("No pool in the map for type \"" + type.ToString() + "\". Maybe it wasn't instantiated?"); } }
public GameObject Do(EffectType effectType, Vector3 worldPosition, Quaternion worldRotation, Transform parent = null) { Effect effect = effects.Where(e => e.effectType == effectType).FirstOrDefault(); if (effect == null) { Debug.LogWarning("Effect of type '" + effectType.ToString() + "' does not exist!"); } GameObject instance = Instantiate(effect.GetRandomVariationPrefab(), worldPosition, worldRotation, parent == null ? transform : parent); Destroy(instance, effect.time); return(instance); }
public static GameObject CreateEffect(EffectType type, Vector3 position, Quaternion rotation, float LifeTime) { if (LifeTime < 0) { switch (type) { case EffectType.Splash: LifeTime = 03.00f; break; case EffectType.Smoke: LifeTime = 12.00f; break; case EffectType.LargeBlood: LifeTime = 03.00f; break; case EffectType.SlashBlood: LifeTime = 03.00f; break; case EffectType.GunDamageBlood: LifeTime = 03.00f; break; case EffectType.Explosion_1x1: LifeTime = 10.00f; break; case EffectType.Explosion_3x3: LifeTime = 10.00f; break; case EffectType.Explosion_10x10: LifeTime = 10.00f; break; case EffectType.GunFire: LifeTime = 00.50f; break; case EffectType.LargeFire: LifeTime = 12.00f; break; case EffectType.NarrowFire: LifeTime = 12.00f; break; case EffectType.Burner: LifeTime = 12.00f; break; case EffectType.ExhaustGas: LifeTime = 12.00f; break; case EffectType.Explosion_40x40: LifeTime = 12.00f; break; case EffectType.GetItems: LifeTime = 04.00f; break; default: print("このエフェクトタイプはライフタイムの自動割り当てが定義されていません"); break; } } var v = (Instantiate(Resources.Load("effect/" + type.ToString()), position, rotation) as GameObject); v.GetComponent <EffectLimitter>().SetLifeTime(LifeTime); v.GetComponent <ParticleSystem>().Play(); return(v); }
private static EffectDef CreateDefault(EffectType type) { var laserEasingCurve = new CubicBezier(Ease.InExpo); var lpfEasingCurve = new CubicBezier(Ease.OutCubic); const float DEF_FILTER_GAIN = 1.0f; switch (type) { case EffectType.PeakingFilter: { var q = new EffectParamF(1, 0.8f); var freq = new EffectParamF(80, 8_000, laserEasingCurve); float gain = 20.0f; return(new BiQuadFilterEffectDef(type, 1.0f, q, gain, freq)); } case EffectType.LowPassFilter: { var q = new EffectParamF(7, 10); var freq = new EffectParamF(10_000, 700, lpfEasingCurve); return(new BiQuadFilterEffectDef(type, 1.0f, q, DEF_FILTER_GAIN, freq)); } case EffectType.HighPassFilter: { var q = new EffectParamF(10, 5); var freq = new EffectParamF(80, 2_000, laserEasingCurve); return(new BiQuadFilterEffectDef(type, 1.0f, q, DEF_FILTER_GAIN, freq)); } case EffectType.BitCrush: { var reduction = new EffectParamF(0, 45 / 44100.0f, laserEasingCurve); return(new BitCrusherEffectDef(1.0f, reduction)); } default: throw new NotImplementedException(type.ToString()); } }
public GameObject Instantiate(EffectType effectType, GameObject parent) { string str = effectType.ToString().ToLower().Replace("_", ""); GameObject prefab = PrefabUtils.GetPrefab(this, str); GameObject go = Instantiate(prefab); // 親のひとつ前に表示 ParticleSystem attackEffectPs = go.GetComponent <ParticleSystem>(); attackEffectPs.GetComponent <Renderer>().sortingOrder = parent.GetComponent <SpriteRenderer>().sortingOrder + 1; // 破棄用リストに追加 gameObjectList.Add(go); return(go); }
public override string ToString() { string result = EffectType.ToString(); if (Axes.Count > 0) { result += ", Axes: "; for (int n = 0; n < Axes.Count; n++) { JoystickAxes axis = Axes[n]; if (n > 0) { result += ", "; } result += axis.ToString(); } } return(result); }
internal Effect(EffectType eType) { _nID = Effect.NextIDGet(); (new Logger()).WriteDebug3("in [hc:" + nID + "][type:" + eType.ToString() + "]"); _eStatus = EffectStatus.Idle; _dtStatusChanged = DateTime.Now; _eType = eType; _iContainer = null; _nFramesTotal = ulong.MaxValue; _nFrameStart = 0; _nFrameCurrent = 0; _nDuration = ulong.MaxValue; _nDelay = 0; _oLock = new object(); _bDisposed = false; _nSimultaneousID = 0; _nSimultaneousTotalQty = 0; _bSimultaneousWait = false; (new Logger()).WriteDebug4("return [hc:" + nID + "]"); }
IEnumerator Fire() { yield return(new WaitForSeconds(initial_delay)); Lava lava = Peripheral.Instance.zoo.getObject(attack_lava, false).GetComponent <Lava>(); lava.SetLocation(this.transform, mousePos, range, Quaternion.identity); lava.Init(effect_type, level, stats, lava_life, true, null); lava.gameObject.SetActive(true); Tracker.Log(PlayerEvent.SpecialSkillUsed, true, customAttributes: new Dictionary <string, string>() { { "attribute_1", effect_type.ToString() }, { "attribute_2", mousePos.x + "_" + mousePos.y } }, customMetrics: new Dictionary <string, double>() { { "metric_1", level } }); }
public void OnInspectorGUI() { EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUI.indentLevel = 1; _effectGUIBox = EditorGUILayout.Foldout(_effectGUIBox, "[Effect] " + _effectType.ToString(), true); if (_effectGUIBox) { EditorGUI.indentLevel++; _effectSpace = EditorGUILayout.Foldout(_effectSpace, "EffectSpace", true); if (_effectSpace) { EditorGUI.indentLevel++; _effectSpaceMin = EditorGUILayout.FloatField(new GUIContent("Min"), _effectSpaceMin); _effectSpaceMax = EditorGUILayout.FloatField(new GUIContent("Max"), _effectSpaceMax); EditorGUI.indentLevel--; } _effectValue = EditorGUILayout.Foldout(_effectValue, "EffectValue", true); if (_effectValue) { EditorGUI.indentLevel++; _effectValueMin = EditorGUILayout.FloatField(new GUIContent("Min"), _effectValueMin); _effectValueMax = EditorGUILayout.FloatField(new GUIContent("Max"), _effectValueMax); EditorGUI.indentLevel--; } _effectCurve = EditorGUILayout.CurveField("EffectCurve", _effectCurve, Color.white, new Rect(_effectSpaceMin, _effectValueMin, _effectSpaceMax - _effectSpaceMin, _effectValueMax - _effectValueMin)); EditorGUILayout.Space(); if (GUILayout.Button("Remove This ScrollEffect")) { _scrollEffects._scrollEffects.Remove(this); } EditorGUILayout.Space(); EditorGUI.indentLevel--; } EditorGUILayout.EndVertical(); }
/// <summary> /// Process an incoming effect /// </summary> private void ViewerEffectHandler(Packet packet, Simulator simulator) { ViewerEffectPacket effect = (ViewerEffectPacket)packet; foreach (ViewerEffectPacket.EffectBlock block in effect.Effect) { EffectType type = (EffectType)block.Type; //LLColor color; //if (block.Color.Length == 4) //{ // color = new LLColor(block.Color, 0); //} //else //{ // Client.Log("Received a ViewerEffect.EffectBlock.Color array with " + block.Color.Length + // " bytes", Helpers.LogLevel.Warning); // color = LLColor.Black; //} // Each ViewerEffect type uses it's own custom binary format for additional data. Fun eh? switch (type) { case EffectType.Text: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.Icon: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.Connector: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.FlexibleObject: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.AnimalControls: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.AnimationObject: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.Cloth: Logger.Log("Received a ViewerEffect of type " + type.ToString() + ", implement me!", Helpers.LogLevel.Warning, Client); break; case EffectType.Glow: Logger.Log("Received a Glow ViewerEffect which is not implemented yet", Helpers.LogLevel.Warning, Client); break; case EffectType.Beam: case EffectType.Point: case EffectType.Trail: case EffectType.Sphere: case EffectType.Spiral: case EffectType.Edit: if (OnEffect != null) { if (block.TypeData.Length == 56) { LLUUID sourceAvatar = new LLUUID(block.TypeData, 0); LLUUID targetObject = new LLUUID(block.TypeData, 16); LLVector3d targetPos = new LLVector3d(block.TypeData, 32); try { OnEffect(type, sourceAvatar, targetObject, targetPos, block.Duration, block.ID); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } else { Logger.Log("Received a " + type.ToString() + " ViewerEffect with an incorrect TypeData size of " + block.TypeData.Length + " bytes", Helpers.LogLevel.Warning, Client); } } break; case EffectType.LookAt: if (OnLookAt != null) { if (block.TypeData.Length == 57) { LLUUID sourceAvatar = new LLUUID(block.TypeData, 0); LLUUID targetObject = new LLUUID(block.TypeData, 16); LLVector3d targetPos = new LLVector3d(block.TypeData, 32); LookAtType lookAt = (LookAtType)block.TypeData[56]; try { OnLookAt(sourceAvatar, targetObject, targetPos, lookAt, block.Duration, block.ID); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } else { Logger.Log("Received a LookAt ViewerEffect with an incorrect TypeData size of " + block.TypeData.Length + " bytes", Helpers.LogLevel.Warning, Client); } } break; case EffectType.PointAt: if (OnPointAt != null) { if (block.TypeData.Length == 57) { LLUUID sourceAvatar = new LLUUID(block.TypeData, 0); LLUUID targetObject = new LLUUID(block.TypeData, 16); LLVector3d targetPos = new LLVector3d(block.TypeData, 32); PointAtType pointAt = (PointAtType)block.TypeData[56]; try { OnPointAt(sourceAvatar, targetObject, targetPos, pointAt, block.Duration, block.ID); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } else { Logger.Log("Received a PointAt ViewerEffect with an incorrect TypeData size of " + block.TypeData.Length + " bytes", Helpers.LogLevel.Warning, Client); } } break; default: Logger.Log("Received a ViewerEffect with an unknown type " + type, Helpers.LogLevel.Warning, Client); break; } } }
public override string ToString() { return("+" + val.ToString() + " " + type.ToString()); }
public void HitEffectObstacle(float value, EffectType type) { Debug.Log ("Effect " + value.ToString()+ " " + type.ToString()); }
internal static string TypeString(EffectType e) { if(e == EffectType.None) return null; if(e == EffectType.SlideDown) return "slideDown"; else if(e == EffectType.FadeIn) return "fadeIn"; else return e.ToString().ToLower(); }
internal static void SetScripts(Page p, EffectType e) { if(e != EffectType.Show && e != EffectType.SlideDown && e != EffectType.FadeIn) Script.AddResourceScript(p, "jquery.effects." + e.ToString().ToLower() + ".js"); }
void ApplyMoveEffect(SkEntity skEntity, Transform trans, Vector3 forceDir, float forcePower) { if (null == m_Param) { return; } float angle = Vector3.Angle(m_PeTrans.existent.forward, forceDir); float thresholdScale = m_Param.m_AngleThresholdScale.Evaluate(angle); forcePower *= m_Param.m_AngleForceScale.Evaluate(angle); thresholdScale *= m_MotionMgr.GetMaskState(PEActionMask.InAir) ? m_Param.m_ThresholdScaleInAir : 1f; EffectType spType = EffectType.Repulsed; if (forcePower < m_SkillCmpt.GetAttribute(AttribType.ThresholdWhacked) * thresholdScale) { spType = EffectType.Null; } else if (forcePower < m_SkillCmpt.GetAttribute(AttribType.ThresholdRepulsed) * thresholdScale) { spType = EffectType.Whacked; } else if (forcePower < m_SkillCmpt.GetAttribute(AttribType.ThresholdWentfly) * thresholdScale) { spType = EffectType.Repulsed; } else if (forcePower < m_SkillCmpt.GetAttribute(AttribType.ThresholdKnocked) * thresholdScale) { spType = EffectType.Wentfly; } else { spType = EffectType.Knocked; } #if UNITY_EDITOR if (m_WriteLog) { Debug.LogError("ForcePower:" + forcePower); Debug.LogError("ThresholdRepulsed:" + m_SkillCmpt.GetAttribute(AttribType.ThresholdRepulsed).ToString()); Debug.LogError(spType.ToString()); } #endif SkAliveEntity skAliveEntity = skEntity as SkAliveEntity; if (null != skAliveEntity) { switch (spType) { case EffectType.Null: ApplyHitEffect(trans, forceDir, forcePower); break; case EffectType.Whacked: m_MotionMgr.DoAction(PEActionType.Whacked); break; case EffectType.Repulsed: ApplyHitEffect(trans, forceDir, forcePower); PEActionParamVVF param = PEActionParamVVF.param; param.vec1 = m_PeTrans.position; param.vec2 = forceDir; param.f = forcePower; m_MotionMgr.DoAction(PEActionType.Repulsed, param); break; case EffectType.Wentfly: case EffectType.Knocked: PEActionParamVFNS paramVFNS = PEActionParamVFNS.param; paramVFNS.vec = forceDir; paramVFNS.f = forcePower; paramVFNS.n = skAliveEntity.Entity.Id; if (null != trans) { paramVFNS.str = trans.name; } else { paramVFNS.str = ""; } m_MotionMgr.DoAction(PEActionType.Wentfly, paramVFNS); break; } } }
public static void PlayEffect(EffectType _EffectType, Transform _Transform, float _DestroyTime) { Debug.Log("1"); new PlayEffect().PlayEffectNow(_Transform, _EffectType.ToString(), _DestroyTime); }
/// <summary> /// Retrieves the effect of the given type at the specified index. (Beneficial, Detrimental, All) /// </summary> /// <param name="type">effect type</param> /// <param name="index">index</param> public Effect Effect(int index, EffectType type = EffectType.All) { Trace.WriteLine(String.Format("Character:CountEffects({0}, {1})", type, index.ToString(CultureInfo.InvariantCulture))); switch (type) { case EffectType.Beneficial: case EffectType.Detrimental: return new Effect(this.GetMember("Effect", type.ToString(), index.ToString(CultureInfo.InvariantCulture))); default: return new Effect(this.GetMember("Effect", index.ToString(CultureInfo.InvariantCulture))); } }
/// <summary> /// Retrieves the effect of the given type at the specified index. (Beneficial, Detrimental, All( /// </summary> /// <param name="type">type</param> /// <param name="name">name</param> public Effect Effect(string name, EffectType type = EffectType.All) { Trace.WriteLine(String.Format("Character:CountEffects({0}, {1})", type, name)); switch (type) { case EffectType.Beneficial: case EffectType.Detrimental: return new Effect(this.GetMember("Effect", type.ToString(), name)); default: return new Effect(this.GetMember("Effect", name)); } }
/// <summary> /// The number of effects. (Beneficial, Detrimental, All) /// </summary> /// <param name="type">type</param> public int NumEffects(EffectType type = EffectType.All) { Trace.WriteLine(String.Format("Character:NumEffects({0})", type)); switch (type) { case EffectType.Beneficial: case EffectType.Detrimental: return this.GetIntFromLSO("NumEffects", type.ToString()); default: return this.GetIntFromLSO("NumEffects"); } }
public void Transition(ref System.Windows.Forms.Panel current, ref System.Windows.Forms.Panel next, EffectType type) { BitmapSource currentBitmapSource = null; BitmapSource nextBitmapSource = null; ImageBrush currentImage = null; ImageBrush nextImage = null; WEPDefaultEffect effect = null; try { // 現在のPanelの画像を取得 currentBitmapSource = GetBitmapSource(current, false); // 次に表示するPanleの画像を取得 string nextBitmapPath = next.Name + ".bmp"; if (System.IO.File.Exists(nextBitmapPath)) { System.Drawing.Imaging.BitmapData bitmapData = null; Bitmap nextBitmap = null; try { nextBitmap = new Bitmap(nextBitmapPath); bitmapData = nextBitmap.LockBits( new System.Drawing.Rectangle(0, 0, nextBitmap.Width, nextBitmap.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); nextBitmapSource = BitmapSource.Create( nextBitmap.Width, nextBitmap.Height, 96, 96, PixelFormats.Bgra32, null, bitmapData.Scan0, nextBitmap.Width * nextBitmap.Height * 4, bitmapData.Stride); } catch (SystemException ex) { Console.WriteLine(ex.Message); } finally { if (bitmapData != null) { nextBitmap.UnlockBits(bitmapData); } } } else { nextBitmapSource = GetBitmapSource(next, true); // 初回のみ } if (type == EffectType.Random) { type = (EffectType)random.Next(effectList.Count); } if (type == EffectType.None) { effect = new WEPDefaultEffect(); } else { effect = effectList[(int)type] as WEPDefaultEffect; } Console.WriteLine(type.ToString()); currentImage = new ImageBrush(currentBitmapSource); nextImage = new ImageBrush(nextBitmapSource); canvas.Width = current.Width; canvas.Height = current.Height; Console.WriteLine(canvas.Width.ToString() + " " + canvas.Height.ToString()); //this.Visibility = Visibility.Visible; // effectスタート current.Visible = false; effect.DrawEffectImage(currentImage, nextImage, ref next, ref canvas); //this.Visibility = Visibility.Hidden; // effect終わり } catch (SystemException ex) { Console.WriteLine(ex.Message); } }