public SpriteLine GetSpriteLine() { SpriteLine spriteLine = lastSpriteLine; var isGoingDown = Direction.Y > 0; var isGoingMostlyLeft = Direction.X <0 && Math.Abs(Direction.X)> Math.Abs(Direction.Y); var isGoingMostlyRight = Direction.X > 0 && Math.Abs(Direction.X) > Math.Abs(Direction.Y); var isGoingMostlyUp = Direction.Y < 0 && Math.Abs(Direction.X) < Math.Abs(Direction.Y); if (isGoingDown) { spriteLine = SpriteLine.FaceDown; } else if (isGoingMostlyLeft) { spriteLine = SpriteLine.FaceLeft; } else if (isGoingMostlyRight) { spriteLine = SpriteLine.FaceRight; } else if (isGoingMostlyUp) { spriteLine = SpriteLine.FaceUp; } lastSpriteLine = spriteLine; return(spriteLine); }
private void RemoveLine() { SpriteLine sl = lines[lines.Count - 1]; lines.Remove(sl); Destroy(sl.gameObject); }
IEnumerator startSkill(Animator animator) { yield return(new WaitForSeconds(0.5f)); lineInstance = KOFItem.InstantiateByPool(line, GameController.instance.transform, gameObject.layer); tankInstance = KOFItem.InstantiateByPool(tank, GameController.instance.transform, gameObject.layer); tankInstance.transform.localPosition = hero.transform.localPosition + pos; var t = tankInstance.transform.position; t.y = 0; lineInstance.SetLine(weapon.spellPoint.transform, t, 0.7f, 1); yield return(new WaitForSeconds(1.4f)); StopSkill(animator); }
private void CreateObjects() { this.mBg = base.transform.Find("Bg").gameObject; this.mScrollView = this.mBg.transform.Find("infoPanel").GetComponent<UIScrollView>(); this.mInfoTable = this.mScrollView.transform.Find("infoContents").gameObject.AddComponent<MailDetailContentTable>(); this.mInfoTable.columns = 1; this.mInfoTable.direction = UITable.Direction.Down; this.mInfoTable.sorting = UITable.Sorting.Custom; this.mInfoTable.hideInactive = true; this.mInfoTable.keepWithinPanel = true; this.mInfoTable.padding = new Vector2(0f, 0f); this.mScrollBar = this.mBg.transform.Find("infoScrollBar").GetComponent<UIScrollBar>(); this.mMailTitle = this.mInfoTable.transform.Find("Title").gameObject.AddComponent<MailTitle>(); this.mMainDetailInfo = this.mInfoTable.transform.Find("infoLabel").gameObject.AddComponent<MailContents>(); this.mMailSender = this.mInfoTable.transform.Find("sender").gameObject.AddComponent<MailSender>(); this.mSpriteLine = this.mInfoTable.transform.Find("line").gameObject.AddComponent<SpriteLine>(); GameObject gameObject = base.transform.Find("MailContentBG").gameObject; UIEventListener expr_18B = UIEventListener.Get(gameObject.gameObject); expr_18B.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_18B.onClick, new UIEventListener.VoidDelegate(this.OnBackGroundClick)); GameObject gameObject2 = this.mBg.transform.Find("takeBtn").gameObject; UIEventListener expr_1CD = UIEventListener.Get(gameObject2); expr_1CD.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1CD.onClick, new UIEventListener.VoidDelegate(this.OnTakeAffixClick)); this.mBtnTxt = gameObject2.transform.Find("Label").GetComponent<UILabel>(); }