public void OnEffectEventRaised(EffectEventType eType) { if (null != EventRaised) { (new Logger()).WriteDebug4("shared:effect:event:" + eType.ToString() + ":before [hc:" + GetHashCode() + "]"); try { EventRaised(eType, this); } catch (System.Net.Sockets.SocketException) { (new Logger()).WriteDebug4("shared:effect:client:lost:dispose:before [hc:" + GetHashCode() + "]"); if (EffectEventType.stopped != eType) { Stop(); } Dispose(); (new Logger()).WriteDebug4("shared:effect:client:lost:dispose:after [hc:" + GetHashCode() + "]"); } catch (Exception ex) { (new Logger()).WriteError(ex); } (new Logger()).WriteDebug4("shared:effect:event:" + eType.ToString() + ":after [hc:" + GetHashCode() + "]"); } else { (new Logger()).WriteDebug4("shared:effect:event:" + eType.ToString() + ":empty [hc:" + GetHashCode() + "]"); } }
public Color GetValue( EffectEventType _type ) { for ( int i = 0; i < propInfos.Count; ++i ) { PropInfo propInfo = propInfos[i]; if ( propInfo.type == _type ) return propInfo.val; } return normal; }
public Color GetValue(EffectEventType _type) { for (int i = 0; i < propInfos.Count; ++i) { PropInfo propInfo = propInfos[i]; if (propInfo.type == _type) { return(propInfo.val); } } return(normal); }
private Sprite GetSpriteForEventType(EffectEventType type) { switch (type) { case EffectEventType.Normal: return(normalEventSprite); case EffectEventType.LongTerm: return(longTermEventSprite); case EffectEventType.God: return(godEventSprite); } return(normalEventSprite); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddEffect_Offset(exSpriteBase _target, EffectEventType _type, exEase.Type _curveType, Vector2 _to, float _duration) { exUIControl ctrl = GetComponent <exUIControl>(); if (ctrl) { EffectInfo_Offset info = new EffectInfo_Offset(); info.duration = _duration; info.target = _target; info.normal = _target.offset; info.curveType = _curveType; EffectInfo_Offset.PropInfo propInfo = new EffectInfo_Offset.PropInfo(); propInfo.type = _type; propInfo.val = _to; info.propInfos.Add(propInfo); EffectState_Offset state = new EffectState_Offset(); state.info = info; state.func = info.GetCurveFunction(); AddState_Offset(ctrl, state); } }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddEffect_Scale(Transform _target, EffectEventType _type, exEase.Type _curveType, Vector3 _to, float _duration) { exUIControl ctrl = GetComponent <exUIControl>(); if (ctrl) { EffectInfo_Scale info = new EffectInfo_Scale(); info.duration = _duration; info.target = _target; info.normal = _target.localScale; info.curveType = _curveType; EffectInfo_Scale.PropInfo propInfo = new EffectInfo_Scale.PropInfo(); propInfo.type = _type; propInfo.val = _to; info.propInfos.Add(propInfo); EffectState_Scale state = new EffectState_Scale(); state.info = info; state.func = info.GetCurveFunction(); AddState_Scale(ctrl, state); } }
public void OnEffectEventRaised(EffectEventType eType) { if (null != EventRaised) { (new Logger()).WriteDebug4("shared:effect:event:" + eType.ToString() + ":before [hc:" + GetHashCode() + "]"); try { EventRaised(eType, this); } catch (System.Net.Sockets.SocketException) { (new Logger()).WriteDebug4("shared:effect:client:lost:dispose:before [hc:" + GetHashCode() + "]"); if (EffectEventType.stopped != eType) Stop(); Dispose(); (new Logger()).WriteDebug4("shared:effect:client:lost:dispose:after [hc:" + GetHashCode() + "]"); } catch (Exception ex) { (new Logger()).WriteError(ex); } (new Logger()).WriteDebug4("shared:effect:event:" + eType.ToString() + ":after [hc:" + GetHashCode() + "]"); } else (new Logger()).WriteDebug4("shared:effect:event:" + eType.ToString() + ":empty [hc:" + GetHashCode() + "]"); }
protected abstract void CallbackTransport(EffectEventType eType, shared.Effect cEffect);
public void Callback(EffectEventType eType, shared.Effect cEffect) { CallbackTransport(eType, cEffect); }
private void AddEventMessage(string _message, EffectEventType _type) { eventMessages.Add(new EventMessage { message = _message, type = _type }); }
private void ApplyEffect(CardData.CardEffectChance effect, string defaultStartText, EffectEventType type) { string message = ""; if (effect != null) { Villagers += effect.villagerChange; Goats += effect.goatChange; Maidens += effect.maidenChange; YoungLads += effect.youngLadChange; deck.AddToDeck(effect.unlockedCards); if (defaultStartText != null && defaultStartText != "") { message += defaultStartText + System.Environment.NewLine; } message += CardData.GetEffectText(effect) + System.Environment.NewLine; } else { if (defaultStartText != null && defaultStartText != "") { message = defaultStartText; } else { message = "Nothing Happened"; } } AddEventMessage(message, type); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddEffect_Scale( Transform _target, EffectEventType _type, exEase.Type _curveType, Vector3 _to, float _duration ) { exUIControl ctrl = GetComponent<exUIControl>(); if ( ctrl ) { EffectInfo_Scale info = new EffectInfo_Scale(); info.duration = _duration; info.target = _target; info.normal = _target.localScale; info.curveType = _curveType; EffectInfo_Scale.PropInfo propInfo = new EffectInfo_Scale.PropInfo(); propInfo.type = _type; propInfo.val = _to; info.propInfos.Add(propInfo); EffectState_Scale state = new EffectState_Scale(); state.info = info; state.func = info.GetCurveFunction(); AddState_Scale( ctrl, state ); } }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddEffect_Offset( exSpriteBase _target, EffectEventType _type, exEase.Type _curveType, Vector2 _to, float _duration ) { exUIControl ctrl = GetComponent<exUIControl>(); if ( ctrl ) { EffectInfo_Offset info = new EffectInfo_Offset(); info.duration = _duration; info.target = _target; info.normal = _target.offset; info.curveType = _curveType; EffectInfo_Offset.PropInfo propInfo = new EffectInfo_Offset.PropInfo(); propInfo.type = _type; propInfo.val = _to; info.propInfos.Add(propInfo); EffectState_Offset state = new EffectState_Offset(); state.info = info; state.func = info.GetCurveFunction(); AddState_Offset( ctrl, state ); } }