public override Box CreateBox(TexStyle style) { if (BaseAtom == null) { return(StrutBox.Empty); } else { Box box; if (UnderLink) { var baseBox = BaseAtom.CreateBox(style); float margin = TEXConfiguration.main.NegateMargin * TexUtility.SizeFactor(style) / 2; float thick = TEXConfiguration.main.LineThickness * TexUtility.SizeFactor(style) / 2; box = HorizontalBox.Get(baseBox); box.Add(StrutBox.Get(-box.width, 0, 0, 0)); box.Add(StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth, margin, thick, StrikeBox.StrikeMode.underline, 0, 0)); return(AttrLinkBox.Get(box, MetaKey)); } else { return(AttrLinkBox.Get(BaseAtom.CreateBox(style), MetaKey)); } } }
public override Box CreateBox() { if (BaseAtom == null) { return(StrutBox.Empty); } else { if (UnderLink) { var baseBox = BaseAtom.CreateBox(); var box = HorizontalBox.Get(baseBox); float factor = TexContext.Scale / 2; float thick = TEXConfiguration.main.LineThickness * factor; box.Add(StrutBox.Get(-box.width, 0, 0, 0)); box.Add(StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth, 0, thick, StrikeBox.StrikeMode.underline, 0, 0)); return(AttrLinkBox.Get(box, MetaKey, Margin)); } else { return(AttrLinkBox.Get(BaseAtom.CreateBox(), MetaKey, Margin)); } } }
void OnIsHit(StrikeBox strikeBox) { SwitchState(StateDictionary[CharacterStates.KnockBack]); PhysicsComponent.Velocity = strikeBox.KnockBack; if (!IsFlipped) { PhysicsComponent.VelocityX = -PhysicsComponent.Velocity.x; } m_HitStopTimer = strikeBox.HitStop.y; m_HitRumbleIntensity = strikeBox.HitRumbleIntesity; m_HitRumbleSpeed = strikeBox.HitRumbleSpeed; }
virtual public void UpdateState(Character refObject) { if (m_BoxFrameData != null) { var keys = from box in m_BoxFrameData.StrikeBoxDictionary where box.Value == refObject.StateTimer select box.Key;; foreach (var key in keys) { StrikeBox strikeBox = (StrikeBox)key; refObject.ActivateBox(strikeBox); } } }
public void Activate(StrikeBox strikeBox) { m_StrikeBoxComponent.m_StrikeBox = strikeBox; m_BoxCollider.offset = strikeBox.Offset; if (m_Caracter.IsFlipped) { m_BoxCollider.offset = new Vector2(-m_BoxCollider.offset.x, m_BoxCollider.offset.y); } m_BoxCollider.size = strikeBox.Size; m_BoxCollider.enabled = true; }
public override Box CreateBox() { if (BaseAtom == null) return StrutBox.Empty; var factor = TexContext.Scale / 2; var margin = useMargin ? TEXConfiguration.main.NegateMargin * factor : 0; var thick = TEXConfiguration.main.LineThickness * factor; var baseBox = BaseAtom.CreateBox(); var result = HorizontalBox.Get(); var negateBox = StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth, margin, thick, (StrikeBox.StrikeMode)mode, offsetM, offsetP); negateBox.shift = baseBox.shift; result.Add(negateBox); result.Add(StrutBox.Get(-baseBox.width, 0, 0, 0)); result.Add(baseBox); return result; }
public override Box CreateBox(TexStyle style) { if (BaseAtom == null) { return(StrutBox.Empty); } var factor = TexUtility.SizeFactor(style) / 2; var margin = useMargin ? TEXConfiguration.main.NegateMargin * factor : 0; var thick = TEXConfiguration.main.LineThickness * factor; var baseBox = BaseAtom.CreateBox(style); var result = HorizontalBox.Get(); var negateBox = StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth, margin, thick, (StrikeBox.StrikeMode)mode, offsetM, offsetP); negateBox.shift = baseBox.shift; result.Add(negateBox); result.Add(StrutBox.Get(-baseBox.width, 0, 0, 0)); result.Add(baseBox); return(result); }
public void ActivateBox(StrikeBox strikeBox) { GetUnusedBox().GetComponent <HitManager>().Activate(strikeBox); }
void OnHasHit(StrikeBox strikeBox) { GameManager.instance.AddScore(this); m_HitStopTimer = strikeBox.HitStop.x; }
public void InvokeHasHit(StrikeBox strikeBox) { OnHasHit(strikeBox); }
public void InvokeIsHit(StrikeBox strikeBox) { OnIsHit(strikeBox); }
public void ActivateBox(StrikeBox box) { m_BoxPoolComponent.ActivateBox(box); }