public static DropAnnounceInfo CreateItemInfo(uint id, int num, out bool is_rare) { is_rare = false; ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(id); if (itemData == null) { return(null); } DropAnnounceInfo dropAnnounceInfo = new DropAnnounceInfo(); int haveingItemNum = MonoBehaviourSingleton <InventoryManager> .I.GetHaveingItemNum(id); haveingItemNum = Mathf.Min(haveingItemNum, MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.ITEM_NUM_MAX); dropAnnounceInfo.text = StringTable.Format(STRING_CATEGORY.IN_GAME, 2000u, itemData.name, num, haveingItemNum); if (!GameDefine.IsRare(itemData.rarity)) { dropAnnounceInfo.color = COLOR.NORMAL; } else { dropAnnounceInfo.color = COLOR.RARE; is_rare = true; } return(dropAnnounceInfo); }
void clearStage() { GameDefine.DestroyAll(transBackground); GameDefine.DestroyAll(transUnit); GameDefine.DestroyAll(transCell); GameDefine.DestroyAll(transEvent); }
public void setDirection(int x, int y) { GameAnimationDirection dir = GameDefine.getDirection(gameMovement.PosX, gameMovement.PosY, x, y); gameMovement.setDirection(dir); }
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 moveTo(int x, int y, int sx, int sy, bool follow, OnEventOver over, bool delay = false) { #if UNITY_EDITOR Debug.Log("GameBattleCursor moveTo " + x + " " + y); #endif moveToX = x; moveToY = y; moveToXReal = GameDefine.getBattleX(x); moveToYReal = GameDefine.getBattleY(y); posXSpeed = sx; posYSpeed = sy; isMoving = true; isFollow = follow; onEventOver = over; if (delay && posX == x && posY == y) { time = -0.5f; } else { time = 0.0f; } }
public void setValue(int hp) { if (start) { pos = movePos; updatePosition(); } if (hp < 0) { hp = 0; } float v = hp / (float)maxHP; movePos = (101.0f - v * 101.0f); dis = 0.0f; textHP.text = GameDefine.getBigInt(hp.ToString(), true); if (right) { transYellow.anchoredPosition = new Vector2(2 + movePos, 0.0f); } else { transYellow.anchoredPosition = new Vector2(-2 - movePos, 0.0f); } white.gameObject.SetActive(true); times = 10; start = true; }
//--------------------------------------------------------------- /* * @brief カメラの回転 */ //--------------------------------------------------------------- public void RotateCamera(float v, float h) { if (!m_camera) { return; } angle_yaw += h * ROTATE_UNIT_ANGLE * GameDefine.FPSDeltaScale(); if (angle_yaw > 360.0f) { angle_yaw -= 360.0f; } if (angle_yaw < 0) { angle_yaw += 360.0f; } angle_pitch += v * ROTATE_UNIT_ANGLE * GameDefine.FPSDeltaScale(); if (angle_pitch > 360.0f) { angle_pitch -= 360.0f; } if (angle_pitch < 0.0f) { angle_pitch += 360.0f; } totalRotation = Quaternion.Euler(angle_pitch, angle_yaw, 0.0f); m_camera.transform.rotation = totalRotation; }
public void clearStage() { for (int j = 0; j < activeBattleStage.Layer.L0.Length; j++) { if (objsLayer0[j] != null) { Destroy(objsLayer0[j]); objsLayer0[j].gameObject.transform.SetParent(null); objsLayer0[j] = null; } } for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++) { if (objsLayer1[j] != null) { Destroy(objsLayer1[j]); objsLayer1[j].gameObject.transform.SetParent(null); objsLayer1[j] = null; } } objsLayer0 = null; objsLayer1 = null; layerList.Clear(); GameDefine.DestroyAll(transBackground); GameDefine.DestroyAll(transCell); }
/// <summary> /// 载入AssetBundle /// </summary> /// <param name="abname"></param> /// <returns></returns> public AssetBundle LoadAssetBundle(string abname) { if (!abname.EndsWith(GameDefine.ExtName)) { abname += GameDefine.ExtName; } AssetBundle bundle = null; if (!bundles.ContainsKey(abname)) { byte[] stream = null; string uri = GameDefine.GetAbDataPath() + abname; Debug.LogWarning("LoadFile::>> " + uri); LoadDependencies(abname); stream = File.ReadAllBytes(uri); bundle = AssetBundle.LoadFromMemory(stream); //关联数据的素材绑定 bundles.Add(abname, bundle); } else { bundles.TryGetValue(abname, out bundle); } return(bundle); }
private void Update() { if (updateSceneButton != null) { MAIN_SCENE mAIN_SCENE = GameDefine.SceneNameToEnum(updateSceneButton); updateSceneButton = null; activeSceneButton = null; UpdateSceneButton(mAIN_SCENE, MAIN_SCENE.HOME, UI._SPR_HOME_ACTIVE, UI.SPR_HOME_ACTIVE_DECORATION, UI._SPR_HOME_INACTIVE); UpdateSceneButton(mAIN_SCENE, MAIN_SCENE.LOUNGE, UI._SPR_LOUNGE_ACTIVE, UI.SPR_LOUNGE_ACTIVE_DECORATION, UI._SPR_LOUNGE_INACTIVE); UpdateSceneButton(mAIN_SCENE, MAIN_SCENE.QUEST, UI._SPR_QUEST_ACTIVE, UI.SPR_QUEST_ACTIVE_DECORATION, UI._SPR_QUEST_INACTIVE); UpdateSceneButton(mAIN_SCENE, MAIN_SCENE.STUDIO, UI._SPR_STUDIO_ACTIVE, UI.SPR_STUDIO_ACTIVE_DECORATION, UI._SPR_STUDIO_INACTIVE); UpdateSceneButton(mAIN_SCENE, MAIN_SCENE.SHOP, UI._SPR_SHOP_ACTIVE, UI.SPR_SHOP_ACTIVE_DECORATION, UI._SPR_SHOP_INACTIVE); if (!isPopMenu) { activeSceneButton = null; } if (MonoBehaviourSingleton <OutGameEffectManager> .IsValid()) { if (activeSceneButton != null) { MonoBehaviourSingleton <OutGameEffectManager> .I.UpdateSceneButtonEffect(mAIN_SCENE, activeSceneButton); } else { MonoBehaviourSingleton <OutGameEffectManager> .I.ReleaseSceneButtonEffect(); } } } }
public void setData(GameItem i, bool b, bool bc) { clear(); if (i == null) { return; } item = i; text.text = i.Name; money.text = GameDefine.getBigInt(bc ? i.Price.ToString() : (i.Price / 2).ToString()); moneyImg.gameObject.SetActive(true); if (b) { icon[(int)item.ItemType].gameObject.SetActive(true); } else { icon1[(int)item.ItemType].gameObject.SetActive(true); } }
public void show(int itemID, int gold, OnEventOver over) { onEventOver = over; show(); string str; if (itemID != GameDefine.INVALID_ID) { str = GameMessageData.instance.getData(GameMessageType.Get1).message[0][1]; GameItem item = GameItemData.instance.getData(itemID); str = str.Replace("0", item.Name); } else { str = GameMessageData.instance.getData(GameMessageType.Get1).message[0][0]; str = str.Replace("0", GameDefine.getBigInt(gold.ToString())); } text.text = str; time = 0.0f; }
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 moveToBattlePos() { posBattleX = GameDefine.getBattleX(posX); posBattleY = GameDefine.getBattleY(posY); updatePosition(); }
public bool moveToDirection(int x, int y, bool start, bool follow, int speed, OnEventOver over) { if (x == posX && y == posY) { return(false); } if (startMoving) { return(false); } moveSpeed = GameDefine.getMoveSpeed(speed); sceneFollow = follow; playStartAnimation = start; onEventOver = over; moveBuffer.Clear(); moveToX = x; moveToY = y; moveToBattleX = GameDefine.getBattleX(x); moveToBattleY = GameDefine.getBattleY(y); startAnimation(); startMoving = true; return(true); }
public static bool IsRare(SortCompareData icon_base) { if (icon_base != null) { return(GameDefine.IsRare(icon_base.GetRarity())); } return(false); }
//-------------------------------------------------------------------- /* * @brief ターゲットOBJへのオフセット座標を更新する */ //-------------------------------------------------------------------- void UpdateOffsetPosition(float v, float h) { float moveX = h * 0.1f * GameDefine.FPSDeltaScale(); float moveY = v * 0.1f * GameDefine.FPSDeltaScale(); m_offsetPos.x += moveX; m_offsetPos.y += moveY; }
public RankingData( int rank, ulong score, GameDefine.StageType clearedStageType, int playerId, string userName ) { this.rank = rank; this.scoreString = score.ToString(); this.clearedStageType = clearedStageType; this.playerId = playerId; this.userName = userName; }
//-------------------------------------------------------------------- /* * @brief ターゲットOBJを回転させる */ //-------------------------------------------------------------------- void RotateTargetObj(float v, float h) { target_yaw += h * ROTATE_UNIT_ANGLE * GameDefine.FPSDeltaScale(); target_pitch += v * ROTATE_UNIT_ANGLE * GameDefine.FPSDeltaScale(); Quaternion rot = Quaternion.Euler(target_pitch, target_yaw, 0.0f); m_targetObj.transform.rotation = rot; }
public void jump(int hp, int mp, GameSkillResutlType type, GameSkillOtherEffect otherType, OnEventOver over) { clear(); gameObject.SetActive(true); onEventOver = over; jumpCount = 0; RectTransform trans = GetComponent <RectTransform>(); position = trans.anchoredPosition; string str = GameDefine.getBigInt(hp.ToString()); if (mp != 0) { str = GameDefine.getBigInt(mp.ToString()); } float ox = 6.0f * str.Length / 2.0f; for (int i = 0; i < str.Length; i++) { GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>("Prefab/TextUI")); trans = obj.GetComponent <RectTransform>(); trans.SetParent(transform); trans.anchoredPosition = new Vector2(-ox + i * 6.0f, 0.0f); trans.localScale = new Vector3(0.5f, 0.5f, 0.5f); GameBattleJumpHPUIText jumpText = obj.GetComponent <GameBattleJumpHPUIText>(); jumpText.jump(-i * 0.1f, onJumpOver); Text text = obj.GetComponent <Text>(); text.text = str.Substring(i, 1); if (type == GameSkillResutlType.Cure || otherType == GameSkillOtherEffect.HealAll) { text.color = new Color(0.0f, 1.0f, 0.0f); } if (hp < 0 || mp < 0) { text.color = new Color(0.0f, 1.0f, 0.0f); } if (mp > 0) { text.color = new Color(0.0f, 0.9f, 1.0f); } objs.Add(obj); } }
private void OnDrag(InputManager.TouchInfo touch_info) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!(loader == null) && !MonoBehaviourSingleton <UIManager> .I.IsDisable() && MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSectionName() == nowSectionName) { loader.get_transform().Rotate(GameDefine.GetCharaRotateVector(touch_info)); } }
void ChangeTargetDistance(float forward, float back) { m_targetDistance -= (forward * 0.25f * GameDefine.FPSDeltaScale()); if (m_targetDistance <= 3.0f) { m_targetDistance = 3.0f; } m_targetDistance += (back * 0.25f * GameDefine.FPSDeltaScale()); }
public void show(int x, int y) { show(); select(0); enable(true); transform.localPosition = new Vector3(GameDefine.getBattleXBound(x), GameDefine.getBattleYBound(y) + GameBattleManager.instance.LayerHeight, 0.0f); }
private void OnDrag(GameObject obj, Vector2 move) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!(playerLoader == null) && !MonoBehaviourSingleton <UIManager> .I.IsDisable() && !(MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSectionName() != "ProfileTop")) { playerLoader.get_transform().Rotate(GameDefine.GetCharaRotateVector(move)); } }
public void moveNext() { moveToX = moveBuffer[1]; moveToY = moveBuffer[0]; moveToBattleX = GameDefine.getBattleX(moveBuffer[1]); moveToBattleY = GameDefine.getBattleY(moveBuffer[0]); moveBuffer.RemoveRange(0, 2); }
public ReplayData( int seed, int playerId, int stageId, GameDefine.DifficultyType difficulty, GameDefine.PlayStyleType playStyle ) { this.PlayerId = playerId; this.StageId = stageId; this.Difficulty = difficulty; this.PlayStyle = playStyle; this.Seed = seed; this.IsValid = true; this.Version = 100; }
public override void Initialize() { object[] array = GameSection.GetEventData() as object[]; baseSkill = (array[0] as SkillItemInfo); SkillItemInfo[] array2 = array[1] as SkillItemInfo[]; material = new SkillItemInfo[array2.Length]; int i = 0; for (int num = array2.Length; i < num; i++) { material[i] = array2[i]; } total = (int)(baseSkill.growCost * (float)material.Length); isEquipConfirm = false; isRareConfirm = false; int j = 0; for (int num2 = material.Length; j < num2; j++) { if (isRareConfirm && isEquipConfirm && isExceedConfirm) { break; } if (!isRareConfirm && GameDefine.IsRare(material[j].tableData.rarity)) { isRareConfirm = true; } if (!isEquipConfirm && material[j].isAttached) { isEquipConfirm = true; } if (!isExceedConfirm && material[j].IsExceeded()) { isExceedConfirm = true; } } Array.Sort(material, delegate(SkillItemInfo l, SkillItemInfo r) { ulong num3 = (ulong)(((long)r.tableData.rarity << 61) + (long)((ulong)(uint)(-1 - (int)r.tableData.id) << 16) + r.level); ulong num4 = (ulong)(((long)l.tableData.rarity << 61) + (long)((ulong)(uint)(-1 - (int)l.tableData.id) << 16) + l.level); int num5 = (num3 != num4) ? ((num3 > num4) ? 1 : (-1)) : 0; if (num5 == 0) { num5 = ((r.exp != l.exp) ? ((r.exp > l.exp) ? 1 : (-1)) : 0); if (num5 == 0) { num5 = ((r.uniqueID != l.uniqueID) ? ((r.uniqueID > l.uniqueID) ? 1 : (-1)) : 0); } } return(num5); }); isExceed = baseSkill.IsLevelMax(); base.Initialize(); }
public int moveTo(int x, int y, byte cb, bool fly, GameUnitCampType camp, bool start, bool follow, int speed, OnEventOver over) { if (x == posX && y == posY) { return(GameDefine.INVALID_ID); } if (startMoving) { return(GameDefine.INVALID_ID); } moveBuffer.Clear(); int count = GameBattlePathFinder.instance.findPath(posX, posY, x, y, cb, fly, camp); if (count == 0) { return(GameDefine.INVALID_ID); } for (int i = count - 3; i >= 0; i--) { moveBuffer.Add(GameBattlePathFinder.instance.pathResult[i]); } int cost = 0; for (int i = 0; i < moveBuffer.Count / 2; i++) { int xx = moveBuffer[i * 2 + 1]; int yy = moveBuffer[i * 2]; cost += GameBattleUnitMovement.instance.getCellCost(xx, yy); } moveSpeed = GameDefine.getMoveSpeed(speed); sceneFollow = follow; playStartAnimation = start; onEventOver = over; canFollow = GameCameraManager.instance.canFollow(posBattleX, posBattleY, GameBattleManager.instance.LayerHeight); moveNext(); startAnimation(); startMoving = true; return(cost); }
public void updateText() { if (bagUI0.Enabled) { itemText.text = bagUI0.getItemDes(); } else { itemText.text = bagUI1.getItemDes(); } moneyText.text = GameDefine.getBigInt(GameUserData.instance.Gold.ToString()); }
void RotateRocket() { float lh = Input.GetAxis("Horizontal"); if (lh > 0.25f || lh < -0.25f) { rocketRot += (lh * 1.0f) * GameDefine.FPSDeltaScale(); Quaternion rot = Quaternion.AngleAxis(rocketRot, transform.up); transform.FindChild("chairs").FindChild("chairs:root").FindChild("chairs:barrel").rotation = rot; } }
public void updateData() { GameBattleStage stage = GameBattleManager.instance.ActiveBattleStage; title.text = stage.SDES.Title; win.text = stage.SDES.Win; lose.text = stage.SDES.Lose; proficiency.text = stage.SDES.Proficiency; int enemyCount = GameBattleUnitManager.instance.getEnemyCount(); string enemyCountStr = enemyCount.ToString(); if (enemyCount < 10) { enemyCountStr = enemyCountStr.Insert(0, "0"); } int userCount = GameBattleUnitManager.instance.getUserCount(); string userCountStr = userCount.ToString(); if (userCount < 10) { userCountStr = userCountStr.Insert(0, "0"); } int npcCount = GameBattleUnitManager.instance.getNpcCount(); string npcCountStr = npcCount.ToString(); if (npcCount < 10) { npcCountStr = npcCountStr.Insert(0, "0"); } int turnCount = GameBattleTurn.instance.Turn; string turnCountStr = turnCount.ToString(); if (turnCount < 10) { turnCountStr = turnCountStr.Insert(0, "00"); } else if (turnCount < 100) { turnCountStr = turnCountStr.Insert(0, "0"); } enemy.text = GameDefine.getBigInt(enemyCountStr); user.text = GameDefine.getBigInt(userCountStr); npc.text = GameDefine.getBigInt(npcCountStr); turn.text = GameDefine.getBigInt(turnCountStr); }
public void jump(GameBattleAttackResultSide side, int hp, OnEventOver over) { clear(); gameObject.SetActive(true); RectTransform trans = GetComponent <RectTransform>(); if (side == GameBattleAttackResultSide.Right) { trans.anchoredPosition = new Vector2(-40.0f, 30.0f); } else { trans.anchoredPosition = new Vector2(54.0f, -24.0f); } position = trans.anchoredPosition; onEventOver = over; jumpCount = 0; string str = GameDefine.getBigInt(hp.ToString()); float ox = 6.0f * str.Length / 2.0f; for (int i = 0; i < str.Length; i++) { GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>("Prefab/TextUI")); trans = obj.GetComponent <RectTransform>(); trans.SetParent(transform); trans.anchoredPosition = new Vector2(-ox + i * 6.0f, 0.0f); trans.localScale = new Vector3(0.5f, 0.5f, 0.5f); GameBattleJumpHPUIText jumpText = obj.GetComponent <GameBattleJumpHPUIText>(); jumpText.jump(-i * 0.1f, onJumpOver); Text text = obj.GetComponent <Text>(); text.text = str.Substring(i, 1); if (hp < 0) { text.color = new Color(0.0f, 1.0f, 0.0f, 1.0f); } objs.Add(obj); } }
public static BrilliantButton Get(GameDefine.ButtonType type) { switch(type) { case GameDefine.ButtonType.Left: return instance.left; case GameDefine.ButtonType.Right: return instance.right; case GameDefine.ButtonType.Top: return instance.top; case GameDefine.ButtonType.Bottom: return instance.bottom; case GameDefine.ButtonType.Decide: return instance.decide; case GameDefine.ButtonType.Cancel: return instance.cancel; } Assert.IsTrue(false, "不正な値です type = " + type); return null; }
public void StageClear( GameDefine.DifficultyType difficulty, int id ) { this.StageClearFrag[(int)difficulty][id] = true; }
public void Insert( GameDefine.DifficultyType difficulty, int rank, RankingData data ) { GetData( difficulty ).Data[rank] = data; }
public void End( GameDefine.StageType stageType ) { this.StageType = stageType; this.TimeStamp = System.DateTime.Now.Ticks; }
public RankingDataList GetData( GameDefine.DifficultyType difficulty ) { return GetData( (int)difficulty ); }
void Awake() { pthis = this; }
public void SetBossType( GameDefine.BossType bossType ) { this.BossType = bossType; ReferenceManager.Instance.refUILayer.BroadcastMessage( GameDefine.StartBossBattleMessage, SendMessageOptions.DontRequireReceiver ); }
/// <summary> /// 引数の難易度のゲームをクリアしたことあるか返す. /// </summary> /// <returns><c>true</c> if this instance is clear game the specified difficulty; otherwise, <c>false</c>.</returns> /// <param name="difficulty">Difficulty.</param> public bool IsClearGame( GameDefine.DifficultyType difficulty ) { return this.StageClearFrag[(int)difficulty].FindIndex( s => s == false ) == -1; }
/// <summary> /// 引数の難易度のステージIDをクリアしているか返す. /// </summary> /// <returns><c>true</c> if this instance is clear the specified difficulty id; otherwise, <c>false</c>.</returns> /// <param name="difficulty">Difficulty.</param> /// <param name="id">Identifier.</param> public bool IsClear( GameDefine.DifficultyType difficulty, int id ) { return this.StageClearFrag[(int)difficulty][id]; }
private Color GetColor( GameDefine.DifficultyType type ) { return difficultyColor[(int)type]; }