void Awake() { trans = transform.parent.GetComponent <RectTransform>(); gameAnimation = GetComponent <GameAnimation>(); gameAnimation.UI = true; }
public void unShowEffect(int id, int s) { for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++) { if (activeBattleStage.Layer.L1[j].Parm == id) { if (objsLayer1[j] == null) { continue; } GameAnimation animation = objsLayer1[j].GetComponent <GameAnimation>(); animation.stopAnimation(); animation.clearAnimation(); } // if ( activeBattleStage.Layer.L1[ j ].ParmEffect != GameDefine.INVALID_ID ) // { // if ( GameUserData.instance.getGameData( activeBattleStage.Layer.L1[ j ].ParmEffect ) != 1 ) // { // GameAnimation animation = objsLayer1[ j ].GetComponent<GameAnimation>(); // animation.stopAnimation(); // animation.clearAnimation(); // } // } } }
public override void initSingleton() { gameAnimation = transform.Find("Cha_tur").GetComponent <GameAnimation>(); transNumbers = transform.Find("Numbers").GetComponent <RectTransform>(); gameObject.SetActive(false); }
public void clear() { startWhite = false; startFadeKill = false; startFade = false; criticalAnimation = null; leftAnimation = null; rightAnimation = null; attackerAnimation = null; defencerAnimation = null; if (floorAnimation != null) { floorAnimation.clearAnimation(); Destroy(floorAnimation.gameObject); floorAnimation = null; } GameDefine.DestroyAll(left); GameDefine.DestroyAll(right); }
public void initPos(int i) { GameRPGPosInfo info = activeInfo.Pos[i]; // GameRPGSceneMovement.instance.moveTo( info.MapPosX , info.MapPosY ); GameMusicManager.instance.playMusic(0, "Music/Music_" + GameDefine.getString2(info.Music)); string path = "Prefab/RPG/Rpgman"; GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path)); gameAnimation = obj.GetComponent <GameAnimation>(); obj.name = "Rpgman"; gameAnimation.playAnimationRPG(GameAnimationType.Stand, GameAnimationDirection.South, null); Transform trans = obj.transform; trans.SetParent(transUnit); trans.localScale = new Vector3(1.0f, 1.0f, 1.0f); movement = obj.AddComponent <GameRPGMovement>(); movement.setPos(info.PosX, info.PosY); movement.setDirection((GameAnimationDirection)info.Direction); GameRPGSceneMovement.instance.followPos(movement.PosBattleX, movement.PosBattleY); }
public void showEffect(int s1, int s2, int s3) { for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++) { if (activeBattleStage.Layer.L1[j].ParmEffect == s1) { if (objsLayer1[j] == null) { continue; } GameAnimation animation = objsLayer1[j].GetComponent <GameAnimation>(); if (s2 == 0) { animation.stopAnimation(); animation.clearAnimation(); } else { if (activeBattleStage.Layer.L1[j].Pause == 0) { animation.playAnimation(); } else { animation.stopAnimation(); animation.showFrame(0); } } } } }
public override void initSingleton() { gameAnimation = transform.Find("map").GetComponentInChildren <GameAnimation>(); image = transform.Find("map/image").GetComponent <Image>(); transImage = image.GetComponent <RectTransform>(); size = transform.Find("map").GetComponent <RectTransform>().sizeDelta; }
void onLevelShowOver() { levelUpAnimation.stopAnimation(); levelUpAnimation.clearAnimation(); Destroy(levelUpAnimation.gameObject); levelUpAnimation.transform.SetParent(null); levelUpAnimation = null; }
void Awake() { gameAnimation = GetComponent <GameAnimation>(); gameAnimation.offsetX = GameDefine.BATTLE_OFFSET_X; gameAnimation.offsetY = GameDefine.BATTLE_OFFSET_Y; // canvas = gameObject.AddComponent<Canvas>(); }
void onAddShowOver() { addAnimation.stopAnimation(); addAnimation.clearAnimation(); Destroy(addAnimation.gameObject); addAnimation.transform.SetParent(null); addAnimation = null; }
public override void onUnShow() { if (gameAnimation != null) { gameAnimation.clearAnimation(); Destroy(gameAnimation); gameAnimation = null; } }
private void getFood(PlayerStatus aPlayer, int aFood, Action aCallback) { if (aFood != 0) { MySoundPlayer.playSe("decision22"); } aPlayer.mFood += aFood; sortPlayerRank(); GameAnimation.getFood(mElement.mPlayerStatusDisplay[aPlayer.mPlayerNumber], aFood, aCallback); }
public void updateTreasures() { GameBattleDTL dtl = activeBattleStage.DTL; string path = "Prefab/Misc/TREASURE"; GameObject gameObject = Resources.Load <GameObject>(path); bool[] bc = new bool[activeBattleStage.MEVT.Length]; for (int i = 0; i < bc.Length; i++) { bc[i] = false; } int ii = 0; for (int i = 0; i < dtl.Height; i++) { for (int j = 0; j < dtl.Width; j++) { if (mapEvent.ContainsKey(dtl.Points[ii].MapEvent)) { bc[dtl.Points[ii].MapEvent] = true; if (mapEvent[dtl.Points[ii].MapEvent].EventType == GameBattleMapEventType.Event) { ii++; continue; } GameObject obj = Instantiate <GameObject>(gameObject, transTreasures); obj.name = dtl.Points[ii].MapEvent.ToString(); Transform trans = obj.transform; trans.localPosition = new Vector3(j * GameDefine.TEXTURE_WIDTH, -i * GameDefine.TEXTURE_HEIGHT + layerHeight, 0.0f); GameAnimation gameAnimation = obj.GetComponent <GameAnimation>(); gameAnimation.playAnimation(); gameAnimation.offsetX = GameDefine.BATTLE_OFFSET_X; gameAnimation.offsetY = GameDefine.BATTLE_OFFSET_Y; } ii++; } } for (int i = 0; i < bc.Length; i++) { if (!bc[i]) { mapEvent.Remove(i); } } }
public override void initSingleton() { for (int i = 0; i < MAX_SLOT; i++) { campText[i] = transform.Find("camp" + i).GetComponent <Text>(); } transPos = transform.Find("pos").GetComponent <RectTransform>(); gameAnimation = transPos.GetComponentInChildren <GameAnimation>(); gameAnimation.UI = true; }
public override void initSingleton() { text = transform.Find("text").GetComponent <Text>(); okText = transform.Find("okText").GetComponent <Text>(); cancelText = transform.Find("cancelText").GetComponent <Text>(); color = text.color; okGameAnimation = transform.Find("ok").GetComponent <GameAnimation>(); cancelGameAnimation = transform.Find("cancel").GetComponent <GameAnimation>(); }
void Awake() { trans = transform.GetComponent <RectTransform>(); for (int i = 0; i < MAX_SLOT; i++) { text[i] = transform.Find("text" + i).GetComponent <Text>(); } transPos = transform.Find("pos").GetComponent <RectTransform>(); gameAnimation = transPos.GetComponentInChildren <GameAnimation>(); }
public void clearAnimation(int id) { if (!animations.ContainsKey(id)) { return; } GameAnimation animation = animations[id]; animation.stopAnimation(); animation.clearAnimation(); }
public void showText(int face, int type, string str) { clear(); if (face != -1) { string path = "Prefab/Face/Face" + (face < 10 ? "0" + face : face.ToString()); GameObject faceObj = Resources.Load <GameObject>(path); if (faceObj == null) { return; } GameObject obj = Instantiate <GameObject>(faceObj); Transform trans = obj.transform; trans.SetParent(faceTrans); trans.localScale = new Vector3(1.0f, 1.0f, 1.0f); trans.localPosition = new Vector3(0.0f, 0.0f, 0.0f); gameAnimation = obj.GetComponent <GameAnimation>(); for (int i = 0; i < gameAnimation.saf1.Length; i++) { for (int j = 0; j < gameAnimation.saf1[i].saf11.Length; j++) { gameAnimation.saf1[i].saf11[j].textureX = 0; gameAnimation.saf1[i].saf11[j].textureY = 0; } } gameAnimation.UI = true; gameAnimation.pivot = pivot; gameAnimation.showFrame(type); if (textTrans.sizeDelta.x == 595) { textTrans.sizeDelta = new Vector2(380, 110); } } else { if (textTrans.sizeDelta.x == 380) { textTrans.sizeDelta = new Vector2(595, 110); } } text.showText(str); }
public override void initSingleton() { trans = transform; GameObject obj = Instantiate(Resources.Load <GameObject>("Prefab/Misc/Cursor")); gameAnimation = obj.GetComponent <GameAnimation>(); gameAnimation.offsetX = -145; gameAnimation.offsetY = 88; obj.transform.SetParent(transform); obj.transform.localPosition = Vector3.zero; }
public void playAnimation(int id, int id2) { if (!animations.ContainsKey(id)) { return; } #if UNITY_EDITOR Debug.Log("playAnimation " + animations[id].gameObject.name); #endif GameAnimation animation = animations[id]; animation.playAnimation(0, GameDefine.INVALID_ID, false); }
public void clearAnimation(int id, int id2) { string str = id + " " + id2; if (!animations.ContainsKey(str)) { return; } GameAnimation animation = animations[str]; animation.stopAnimation(); animation.clearAnimation(); }
public void clear() { text.clear(); if (gameAnimation != null) { gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); Destroy(gameAnimation.gameObject); gameAnimation.transform.SetParent(null); gameAnimation = null; } }
public void clearAnimation() { for (int i = 0; i < objects.Count; i++) { Destroy(objects[i]); objects[i].transform.SetParent(null); } objects.Clear(); objectsAlpha.Clear(); otherGameAnimation = null; Resources.UnloadUnusedAssets(); }
void Awake() { for (int i = 0; i < MAX_SLOT; i++) { slot[i] = transform.Find("slot" + i).GetComponent <GameAlchemyUISlot>(); } text = transform.Find("text").GetComponent <Text>(); image = GetComponent <Image>(); askUI = GetComponentInChildren <GameAskUI>(); upAnimation = transform.Find("up").GetComponentInChildren <GameAnimation>(); downAnimation = transform.Find("down").GetComponentInChildren <GameAnimation>(); }
public void playAnimation(int id, int id2, int frame, int endFrame, OnEventOver over) { string str = id + " " + id2; if (!animations.ContainsKey(str)) { return; } #if UNITY_EDITOR Debug.Log("playAnimation " + animations[str].gameObject.name); #endif GameAnimation animation = animations[str]; Transform trans = animation.transform; trans.localPosition = new Vector3(GameRPGSceneMovement.instance.PosXReal, GameRPGSceneMovement.instance.PosYReal + layerHeight, -id2 * 20); if (frame == GameDefine.INVALID_ID) { animation.playAnimation(0, GameDefine.INVALID_ID, false, over); } else { if (frame == endFrame) { animation.stopAnimation(); animation.showFrame(endFrame); if (over != null) { over(); } } else { animation.playAnimation(frame, endFrame + 1, false, over); } // animation.stopAnimation(); // animation.showFrame( frame ); } }
/// <summary>プレイヤの手番の順番をシャッフル</summary> private void shufflePlayerTurn(Action aCallback) { int[] tTurn = new int[mElement.mPlayerStatus.Length]; for (int i = 0; i < mElement.mPlayerStatus.Length; i++) { tTurn[i] = i; } tTurn = tTurn.OrderBy(i => Guid.NewGuid()).ToArray(); GameAnimation.playerShuffle(mElement.mPlayerStatusDisplay, mElement.mPlayerStatus, tTurn, () => { for (int i = 0; i < mElement.mPlayerStatus.Length; i++) { //結果をstatusに適用 mElement.mPlayerStatus[tTurn[i]].mTurn = i; mTurn = tTurn; } aCallback(); }); }
public void clear() { visibleLayer(true); clearStage(); activeID = GameDefine.INVALID_ID; activeDTL = null; activeRPGStage = null; activeInfo = null; objsLayer1 = null; objsLayer0 = null; movement = null; gameAnimation = null; animations.Clear(); }
private void moveFood(PlayerStatus aGetter, PlayerStatus aPayer, int aFood, Action aCallback) { MySoundPlayer.playSe("decision14"); aGetter.mFood += aFood; aPayer.mFood -= aFood; sortPlayerRank(); CallbackSystem tSystem = new CallbackSystem(); GameAnimation.getFood(mElement.mPlayerStatusDisplay[aGetter.mPlayerNumber], aFood, tSystem.getCounter()); GameAnimation.getFood(mElement.mPlayerStatusDisplay[aPayer.mPlayerNumber], -aFood, tSystem.getCounter()); tSystem.then(() => { if (aPayer.mFood < 0) { endanger(aPayer, aCallback); return; } aCallback(); }); }
private void lostFood(PlayerStatus aPlayer, int aFood, Action aCallback) { if (aFood != 0) { MySoundPlayer.playSe("decision14"); } aPlayer.mFood -= aFood; sortPlayerRank(); GameAnimation.getFood(mElement.mPlayerStatusDisplay[aPlayer.mPlayerNumber], -aFood, () => { if (aPlayer.mFood >= 0) { aCallback(); } else { endanger(aPlayer, aCallback); } }); }
public void showLevelUp(OnEventOver over) { if (!isShow) { over(); return; } if (side == GameBattleAttackResultSide.Left) { if (rangedAttack) { rightAnimation.stopAnimation(); rightAnimation.clearAnimation(); } } else { if (rangedAttack) { leftAnimation.stopAnimation(); leftAnimation.clearAnimation(); } } string path = "Prefab/Misc/Ftlup_r"; GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path)); Transform trans = obj.transform; trans.SetParent(right.transform); trans.localScale = Vector3.one; trans.localPosition = Vector3.zero; levelUpAnimation = obj.GetComponent <GameAnimation>(); levelUpAnimation.UI = true; levelUpAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onLevelShowOver); rightAnimation.playAnimation(6, 6 + rightAnimation.safHead.count3[0], false, over); }
public void Enqueue(GameAnimation NextAnimation) { List<GameAnimation> l = new List<GameAnimation>(); l.Add(NextAnimation); Enqueue(l); }
// Update is called once per frame void Update() { float scrollUpdate = Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime * scrollSpeed.y; float xUpdate = Input.GetAxis("Horizontal") * Time.deltaTime * scrollSpeed.x; float zUpdate = Input.GetAxis("Vertical") * Time.deltaTime * scrollSpeed.z; xPercent += xUpdate; zPercent += zUpdate; if (scrollUpdate != 0) { /*xPercent = xPercent + (scrollUpdate * scrollSpeed.x) * (tentativePercent.x - xPercent); zPercent = zPercent + (scrollUpdate * scrollSpeed.z) * (tentativePercent.z - zPercent);*/ if (zoomPercent != 1 ) { Vector3 tentativePercent = WorldToPercent(MouseToWorld()); xPercent = tentativePercent.x; zPercent = tentativePercent.z; } zoomPercent = zoomPercent + scrollUpdate; zoomPercent = Mathf.Min(zoomPercent, 1); zoomPercent = Mathf.Max(0, zoomPercent); } xPercent = Mathf.Min(xPercent, 1); xPercent = Mathf.Max(0, xPercent); zPercent = Mathf.Min(zPercent, 1); zPercent = Mathf.Max(0, zPercent); float zoomX = zoomPercent * (xPercent - 0.5f) *2 * xRange; float zoomY = YfromZoomPercent(); float zoomZ = zoomPercent *(zPercent - 0.5f) * 2 * zRange; float zoomAngleX = fartherstZoomXAngle; if (zoomPercent >= angleChangeZoomPercent) { float partialPercent = (zoomPercent - angleChangeZoomPercent) / (1 - angleChangeZoomPercent); zoomAngleX = fartherstZoomXAngle - partialPercent * (fartherstZoomXAngle - closestZoomXAngle); zoomZ += partialPercent * closestAdjustZ; } translateAnimation = new GameAnimation(transform, AnimationTypes.Simple, adjust+ new Vector3(zoomX, zoomY, zoomZ), Quaternion.Euler(zoomAngleX, 0, 0), 0.25f); translateAnimation.Continue(); }
public virtual void Start() { gameAnimation = GetComponent<GameAnimation>(); }
public AnimationChain(GameAnimation gameAnimation) { Enqueue(gameAnimation); }