public void clear() { text = ""; gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); }
public override void onUnShow() { if (gameAnimation != null) { gameAnimation.clearAnimation(); Destroy(gameAnimation); gameAnimation = null; } }
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 void updateUpDonw() { upAnimation.stopAnimation(); upAnimation.clearAnimation(); downAnimation.stopAnimation(); downAnimation.clearAnimation(); if (selectionPos > 0) { if (!enabled1) { upAnimation.showFrame(18); } else { upAnimation.playAnimation(18, 22); } } if (selectionPos < itemCount - MAX_SLOT) { if (!enabled1) { downAnimation.showFrame(22); } else { downAnimation.playAnimation(22, 26); } } }
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 unShow() { isShow = false; gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); }
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(); // } // } } }
void onDouble() { criticalAnimation.clearAnimation(); if (side == GameBattleAttackResultSide.Left) { leftAnimation.stopAnimation(); leftAnimation.clearAnimation(); } else { rightAnimation.stopAnimation(); rightAnimation.clearAnimation(); } attackerAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAttackOver2); }
void onAddShowOver() { addAnimation.stopAnimation(); addAnimation.clearAnimation(); Destroy(addAnimation.gameObject); addAnimation.transform.SetParent(null); addAnimation = null; }
void onLevelShowOver() { levelUpAnimation.stopAnimation(); levelUpAnimation.clearAnimation(); Destroy(levelUpAnimation.gameObject); levelUpAnimation.transform.SetParent(null); levelUpAnimation = null; }
public void unShow() { isShow = false; gameObject.SetActive(false); gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); }
void clear() { text.text = ""; okText.text = ""; cancelText.text = ""; okGameAnimation.stopAnimation(); okGameAnimation.clearAnimation(); cancelGameAnimation.stopAnimation(); cancelGameAnimation.clearAnimation(); }
public void clearAnimation(int id) { if (!animations.ContainsKey(id)) { return; } GameAnimation animation = animations[id]; animation.stopAnimation(); animation.clearAnimation(); }
public void unShow() { GameBattleUserLeftUI.instance.unShowFade(); GameBattleUserRightUI.instance.unShowFade(); isShow = false; gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); gameObject.SetActive(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 showUser(bool b) { isShowUser = b; if (b) { left.stopAnimation(); left.clearAnimation(); right.stopAnimation(); right.clearAnimation(); select(0); } else { clearSelection(); left.playAnimation(14, 18); right.playAnimation(18, 22); } }
public void addAnimation(int id, int id2) { GameAnimation ani = null; string str = id + " " + id2; if (animations.ContainsKey(str)) { ani = animations[str]; ani.stopAnimation(); ani.clearAnimation(); Destroy(ani.gameObject); ani.transform.SetParent(null); animations.Remove(str); } for (int i = 0; i < activeRPGStage.Layer.L1.Length; i++) { if (activeRPGStage.Layer.L1[i].ID == id && activeRPGStage.Layer.L1[i].Parm == id2) { string path = "Prefab/RPG/RPG" + GameDefine.getString2(activeID) + "/"; path += activeRPGStage.Layer.L1[i].Name; GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path)); ani = obj.GetComponent <GameAnimation>(); Transform trans = obj.transform; trans.SetParent(transEvent); trans.localPosition = new Vector3(0.0f, layerHeight, 0.0f); trans.localScale = new Vector3(1.0f, 1.0f, 1.0f); animations.Add(str, ani); return; } } }
public void addAnimation(int id, int name) { GameAnimation ani = null; if (animations.ContainsKey(id)) { ani = animations[id]; ani.stopAnimation(); ani.clearAnimation(); ani.transform.SetParent(null); Destroy(ani.gameObject); animations.Remove(id); } // else // { string path = "Prefab/Stage/Stage" + GameDefine.getString2(GameUserData.instance.Stage) + "/Eanm_"; path += GameDefine.getString2(name); GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path)); ani = obj.GetComponent <GameAnimation>(); obj.name = "Eanm_" + GameDefine.getString2(name); Transform trans = obj.transform; trans.SetParent(transBackground); trans.localPosition = new Vector3(0.0f, layerHeight, 0.0f); trans.localScale = new Vector3(1.0f, 1.0f, 1.0f); ani.lastUnitID = LastUnitID; LastUnitID = GameDefine.INVALID_ID; animations.Add(id, ani); // } }
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 clearAnimation() { gameAnimation.clearAnimation(); }
public void clearGameAnimation() { gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); }
public void show(byte f, GameBattleUnit lt, GameBattleUnit rt, GameBattleAttackResultSide s, GameBattleAttackResultPhysical rs, bool o, OnEventOver over) { clear(); skill = null; onEventOver = over; result = rs; resultSkill = null; side = s; isShow = true; overUnShow = false; showAdd = false; mapAttack = false; gameObject.SetActive(true); leftUnit = lt; rightUnit = rt; string path = "Prefab/Stage/Stage" + GameDefine.getString2(GameUserData.instance.Stage) + "/FLOOR_"; path += GameDefine.getString2(GameUserData.instance.Stage); GameObject gameObjectFloor = Instantiate <GameObject>(Resources.Load <GameObject>(path)); floorAnimation = gameObjectFloor.GetComponent <GameAnimation>(); floorAnimation.UI = true; floorAnimation.showFrame(f); floorAnimation.transform.SetParent(floorTrans); floorAnimation.transform.localScale = Vector3.one; floorAnimation.transform.localPosition = Vector3.zero; // string ab = result.type == GameBattleAttackResultType.Block ? "ab" : "a"; path = "Prefab/Sprite/man" + GameDefine.getString3(rt.Sprite) + "/"; path += (GameDefine.getString3(rt.Sprite) + "MISC"); GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path)); rightAnimation = obj.GetComponent <GameAnimation>(); rightAnimation.UI = true; rightAnimation.showFrame(6 + (rightAnimation.safHead.count3[0] == 0 ? 1 : rightAnimation.safHead.count3[0])); Transform trans = obj.transform; trans.SetParent(right.transform); trans.localScale = Vector3.one; trans.localPosition = Vector3.zero; rightInfoUI.gameObject.SetActive(true); rightInfoUI.setValue(rt.HP, rt.HPMax, rt.Name); path = "Prefab/Sprite/man" + GameDefine.getString3(lt.Sprite) + "/"; path += (GameDefine.getString3(lt.Sprite) + "MISC"); obj = Instantiate <GameObject>(Resources.Load <GameObject>(path)); leftAnimation = obj.GetComponent <GameAnimation>(); leftAnimation.UI = true; leftAnimation.showFrame(6 + (leftAnimation.safHead.count3[0] == 0 ? 1 : leftAnimation.safHead.count3[0])); trans = obj.transform; trans.SetParent(left.transform); trans.localScale = Vector3.one; trans.localPosition = Vector3.zero; leftInfoUI.gameObject.SetActive(true); leftInfoUI.setValue(lt.HP, lt.HPMax, lt.Name); if (side == GameBattleAttackResultSide.Left) { path = "Prefab/Sprite/man" + GameDefine.getString3(lt.Sprite) + "/" + GameDefine.getString3(lt.Sprite); path += (result.type == GameBattleAttackResultPhysical.Type.Block ? "ab" : "a"); GameObject object1 = Resources.Load <GameObject>(path); if (object1 == null) { onShowOver(); return; } obj = Instantiate <GameObject>(object1); attackerAnimation = obj.GetComponent <GameAnimation>(); attackerAnimation.UI = true; attackerAnimation.onAnimationEvent = onAnimationEvent; trans = obj.transform; trans.SetParent(left.transform); trans.localScale = Vector3.one; trans.localPosition = Vector3.zero; defencerAnimation = rightAnimation; RectTransform trans1 = left.GetComponent <RectTransform>(); trans1.SetSiblingIndex(3); rangedAttack = (lt.AttackType == GameUnitAttackType.Ranged); if (rangedAttack) { rightAnimation.clearAnimation(); } } else { path = "Prefab/Sprite/man" + GameDefine.getString3(rt.Sprite) + "/" + GameDefine.getString3(rt.Sprite); path += (result.type == GameBattleAttackResultPhysical.Type.Block ? "ab" : "a"); GameObject object1 = Resources.Load <GameObject>(path); if (object1 == null) { onShowOver(); return; } obj = Instantiate <GameObject>(object1); attackerAnimation = obj.GetComponent <GameAnimation>(); attackerAnimation.UI = true; attackerAnimation.onAnimationEvent = onAnimationEvent; trans = obj.transform; trans.SetParent(right.transform); trans.localScale = Vector3.one; trans.localPosition = Vector3.zero; defencerAnimation = leftAnimation; RectTransform trans1 = right.GetComponent <RectTransform>(); trans1.SetSiblingIndex(3); rangedAttack = (rt.AttackType == GameUnitAttackType.Ranged); if (rangedAttack) { leftAnimation.clearAnimation(); } } attackerAnimation.otherGameAnimation = defencerAnimation; if (o) { onShowOver(); } else { scale = 2.0f; alpha = 0.1f; time = 0.0f; alphaAdd = true; startFade = true; updateStage(); } }
private void onAnimationEvent(int i) { if (mapAttack) { return; } GameAnimation.SAF1 saf1 = attackerAnimation.saf1[i]; bool hideDefencer = (attackerAnimation.safHead.count3[1] > 0 && i >= attackerAnimation.safHead.count3[1] && i < attackerAnimation.safHead.count3[2]); if (hideDefencer && defencerAnimation.start) { defencerAnimation.stopAnimation(); defencerAnimation.clearAnimation(); } if (saf1.hit > 0) { if (!showAdd && result.AddType != GameAttackAddType.None) { showAdd = true; switch (result.AddType) { case GameAttackAddType.AbsorbHP: break; case GameAttackAddType.Poison: { string path = "Prefab/Misc/Sp003" + (side == GameBattleAttackResultSide.Left ? "l" : "r"); GameObject obj = Instantiate(Resources.Load <GameObject>(path)); addAnimation = obj.GetComponent <GameAnimation>(); addAnimation.UI = true; obj.transform.SetParent(attackerAnimation.transform.parent); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; addAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAddShowOver); } break; case GameAttackAddType.Palsy: { string path = "Prefab/Misc/Sp005" + (side == GameBattleAttackResultSide.Left ? "l" : "r"); GameObject obj = Instantiate(Resources.Load <GameObject>(path)); addAnimation = obj.GetComponent <GameAnimation>(); addAnimation.UI = true; obj.transform.SetParent(attackerAnimation.transform.parent); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; addAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAddShowOver); } break; case GameAttackAddType.Silence: { string path = "Prefab/Misc/Sp002" + (side == GameBattleAttackResultSide.Left ? "l" : "r"); GameObject obj = Instantiate(Resources.Load <GameObject>(path)); addAnimation = obj.GetComponent <GameAnimation>(); addAnimation.UI = true; obj.transform.SetParent(attackerAnimation.transform.parent); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; addAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAddShowOver); } break; case GameAttackAddType.Fetter: break; case GameAttackAddType.Clear: break; } } if (result.type == GameBattleAttackResultPhysical.Type.Block) { if (defencerAnimation.startFrame != 0 && !hideDefencer) { defencerAnimation.playAnimation(0, 1); } } else { if (result.type == GameBattleAttackResultPhysical.Type.Critical) { white.SetActive(true); startWhite = true; timeWhite = 0.0f; } if (defencerAnimation.startFrame != 1 && !hideDefencer) { defencerAnimation.playAnimation(1, 3); } } if (side == GameBattleAttackResultSide.Left) { rightInfoUI.setValue(hitHP[hitCount]); } else { leftInfoUI.setValue(hitHP[hitCount]); } hitCount++; } else { if (rangedAttack && attackerAnimation.safHead.count3[0] > i) { return; } int f = 6 + (defencerAnimation.safHead.count3[0] == 0 ? 1 : defencerAnimation.safHead.count3[0]); if (defencerAnimation.startFrame != f && !hideDefencer) { defencerAnimation.playAnimation(f, f + defencerAnimation.safHead.count3[1]); } } }
void onAttackOver2() { GameBattleJumpHPUI.instance.jump(side, jumpHP, onJumpHPOver2); attackerAnimation.stopAnimation(); attackerAnimation.clearAnimation(); if (side == GameBattleAttackResultSide.Left) { int f = 6 + (leftAnimation.safHead.count3[0] == 0 ? 1 : leftAnimation.safHead.count3[0]); if (!rangedAttack) { leftAnimation.playAnimation(f, f + leftAnimation.safHead.count3[1]); } f = 6 + (rightAnimation.safHead.count3[0] == 0 ? 1 : rightAnimation.safHead.count3[0]); rightAnimation.playAnimation(f, f + rightAnimation.safHead.count3[1]); } else { int f = 6 + (rightAnimation.safHead.count3[0] == 0 ? 1 : rightAnimation.safHead.count3[0]); if (!rangedAttack) { rightAnimation.playAnimation(f, f + rightAnimation.safHead.count3[1]); } f = 6 + (leftAnimation.safHead.count3[0] == 0 ? 1 : leftAnimation.safHead.count3[0]); leftAnimation.playAnimation(f, f + leftAnimation.safHead.count3[1]); } int HP = 0; if (side == GameBattleAttackResultSide.Left) { HP = rightUnit.HP; } else { HP = leftUnit.HP; } kill = (HP <= result.HP + result.HP2); hitHP.Clear(); jumpHP = result.HP2; hitCount = 0; for (int i = 0; i < attackerAnimation.saf1.Length; i++) { if (attackerAnimation.saf1[i].hit > 0) { hitCount++; } } int[] hit = new int[hitCount]; hitCount = 0; for (int i = 0; i < attackerAnimation.saf1.Length; i++) { if (attackerAnimation.saf1[i].hit > 0) { hit[hitCount] = i; hitCount++; } } int hitAll = 0; for (int i = 0; i < hitCount; i++) { hitAll += hit[i]; } float per = 0.0f; for (int i = 0; i < hitCount; i++) { per += hit[i] / (float)hitAll; if (i == hitCount - 1) { hitHP.Add(HP - result.HP - jumpHP); } else { hitHP.Add(HP - result.HP - (int)(per * jumpHP)); } } hitCount = 0; }
public void playAnimation(int id, int id2, int frame, int endFrame, OnEventOver over) { if (!animations.ContainsKey(id)) { return; } #if UNITY_EDITOR Debug.Log("playAnimation " + animations[id].gameObject.name); #endif onEventOver = over; GameAnimation animation = animations[id]; int height = layerHeight; bool bUpdateHeight = false; if (id2 >= 10000500 && GameUserData.instance.Stage == 19) { // fix stage 7 19 bug height = 2 * 5000; bUpdateHeight = true; GameAnimation ani = objsLayer0[1].GetComponent <GameAnimation>(); ani.stopAnimation(); ani.clearAnimation(); } if ((id2 >= 20000000 && GameUserData.instance.Stage == 7) || (id2 >= 20000000 && GameUserData.instance.Stage == 14)) { // fix stage 7 14 bug height = 2 * 5000; bUpdateHeight = true; } float z = GameDefine.getZ(id2); if (id2 >= 20000000) { z -= 3000; } Transform trans = animation.transform; if (animation.lastUnitID != GameDefine.INVALID_ID) { GameBattleUnit unit = GameBattleUnitManager.instance.getUnit(animation.lastUnitID); GameBattleSceneMovement.instance.moveToEvent(unit.PosX - GameCameraManager.instance.xCell, unit.PosY - GameCameraManager.instance.yCell); trans.localPosition = new Vector3(GameBattleSceneMovement.instance.PosXReal, GameBattleSceneMovement.instance.PosYReal + height, z); } else { trans.localPosition = new Vector3(GameBattleSceneMovement.instance.AnimationPosX, GameBattleSceneMovement.instance.AnimationPosY + height, z); } if (id2 >= 20000000 && GameUserData.instance.Stage == 23) { // fix stage 23 bug trans.localPosition = new Vector3(GameBattleSceneMovement.instance.PosXReal, GameBattleSceneMovement.instance.PosYReal + height, z); trans.localScale = new Vector3(GameCameraManager.instance.sceneWidth / 320.0f, 1.0f, 1.0f); } if (id2 == 10000500 && GameUserData.instance.Stage == 24) { // fix stage 24 bug trans.localPosition = new Vector3(260.0f, -620.0f + height, z); } if (frame == GameDefine.INVALID_ID) { animation.playAnimation(0, GameDefine.INVALID_ID, false, onEffectPlayOver); } else { if (frame == endFrame) { animation.stopAnimation(); animation.showFrame(endFrame); if (onEventOver != null) { onEventOver(); } } else { animation.playAnimation(frame, endFrame + 1, false, onEffectPlayOver); } // animation.stopAnimation(); // animation.showFrame( frame ); } if (bUpdateHeight) { GameCameraManager.instance.setPos(GameBattleSceneMovement.instance.PosXReal, GameBattleSceneMovement.instance.PosYReal + height); } }
public override void onUnShow() { gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); }