public override void Draw(Rect inRect, AbilityWindow window) { Widgets.DrawBoxSolid(inRect, new Color(21f / 256f, 25f / 256f, 29f / 256f)); var drawBox = inRect.ContractedBy(5f); var yAnchor = drawBox.y; var xAnchor = drawBox.x; // Draw top matter DrawTopMatter(xAnchor, ref yAnchor, drawBox.width); // Draw invert option DrawInvertOption(ref xAnchor, yAnchor); //Draw threshold option Widgets.Label( new Rect(drawBox.xMax - (ThresholdLabelWidth + ThresholdFillableWidth + XSeparation), yAnchor, ThresholdLabelWidth, OptionHeight), ThresholdKey.Translate()); Widgets.IntEntry( new Rect(drawBox.xMax - ThresholdFillableWidth, yAnchor, ThresholdFillableWidth, OptionHeight), ref Threshold, ref thresholdBuffer); yAnchor += OptionHeight + YSeparation; // Draw bottom matter Text.Anchor = TextAnchor.MiddleCenter; DrawBottomMatter(drawBox.x, yAnchor, drawBox.width, window); Text.Anchor = TextAnchor.UpperLeft; }
protected void DrawBottomMatter(float xAnchor, float yAnchor, float width, AbilityWindow window) { // Draw info button Widgets.InfoCardButton(xAnchor, yAnchor, Def); // Draw remove button var buttonRect = new Rect(xAnchor + width - RemoveButtonWidth, yAnchor, RemoveButtonWidth, RemoveButtonHeight); if (Widgets.ButtonText(buttonRect, RemoveKey.Translate())) { window.ScheduleConditionForRemoval(this); } }
// Use this for initialization void Start() { GameObject man = GameObject.Find("Manager"); MVPManager mvp = man.GetComponent <MVPManager> (); leftc = mvp.leftc.GetComponent <GameController> (); rightc = mvp.rightc.GetComponent <GameController> (); lefta = GameObject.Find("AbilityWindowL").GetComponent <AbilityWindow> (); righta = GameObject.Find("AbilityWindowR").GetComponent <AbilityWindow> (); start = Time.time; }
public override void Draw(Rect inRect, AbilityWindow window) { Widgets.DrawBoxSolid(inRect, new Color(21f / 256f, 25f / 256f, 29f / 256f)); var drawBox = inRect.ContractedBy(5f); var xAnchor = drawBox.x; var yAnchor = drawBox.y; // Draw top matter DrawTopMatter(drawBox.x, ref yAnchor, drawBox.width); // Draw invert option DrawInvertOption(ref xAnchor, yAnchor); yAnchor += OptionHeight + YSeparation; // Draw bottom matter Text.Anchor = TextAnchor.MiddleCenter; DrawBottomMatter(drawBox.x, yAnchor, drawBox.width, window); Text.Anchor = TextAnchor.UpperLeft; }
public abstract void Draw(Rect inRec, AbilityWindow window);