public override void Action(CharacterBase character, SceneBattle battle) { if (character.waittime < 1) { character.animationpoint = new Point(4, 0); } else if (character.waittime < 3) { character.animationpoint = new Point(5, 0); } else if (character.waittime < 10) { character.animationpoint = new Point(6, 0); } else if (character.waittime == 5) { character.animationpoint = new Point(5, 0); } else if (character.waittime == 24) { base.Action(character, battle); } if (character.waittime != 6) { return; } this.sound.PlaySE(SoundEffect.dark); StoneBall stoneBall = new StoneBall(this.sound, battle, character.position.X + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 2, character.positionDirect, ChipBase.ELEMENT.normal, 20); stoneBall.positionDirect.X += 40 * this.UnionRebirth(character.union); stoneBall.positionDirect.Y += 16f; character.parent.attacks.Add(this.Paralyze(stoneBall)); }
private void resetStoneBall(int ballNumber) { if (_stoneBallObj != null) { GameObject.Destroy(_stoneBallObj); } if (stoneBallPrefab != null && stoneHangArea != null) { //创建 _stoneBallObj = GameObject.Instantiate(stoneBallPrefab); // RectTransform startArea = stoneStartArea.GetComponent <RectTransform>(); float startY = startArea.localPosition.y; //随机一个位置 RectTransform hangArea = stoneHangArea.GetComponent <RectTransform>(); float width = hangArea.sizeDelta.x; float hangY = hangArea.localPosition.y; float startX = hangArea.localPosition.x - width / 2; float endX = hangArea.localPosition.x + width / 2; float x = GameModel.getInstance().getRandomNumber((int)startX, (int)endX); //石球放到start的位置 _stoneBallObj.transform.localPosition = new Vector3(x, startY, 0); _stoneBallObj.transform.SetParent(this.transform, false); //石球的层次 _stoneBallObj.transform.SetSiblingIndex(0); //石球move到hang的位置 Hashtable args = iTween.Hash(); args.Add("islocal", true); args.Add("position", new Vector3(x, hangY, 0)); args.Add("time", 1.0f); args.Add("easetype", "easeOutBack"); args.Add("oncomplete", "ready"); args.Add("oncompletetarget", _stoneBallObj); iTween.MoveTo(_stoneBallObj, args); //随机一个数值 StoneBall logic = _stoneBallObj.GetComponent <StoneBall>(); logic.setNumber(ballNumber); } }