void BackTopoint() { if (Distance.isSmash) { // if (playerPos != pontoInicial) // { // transform.position = Vector3.Lerp(transform.position, new Vector3(pontoInicial,transform.position.y, transform.position.z), Time.deltaTime * 5); // extremidade = false; // } if (playerPos != pontoInicial) { if (playerPos < pontoInicial) { rb.velocity = new Vector3(playerVel, 0, 0); Invoke("Back2", 0.1f); extremidade = false; point = PlayerPoint.CENTER; } if (playerPos > pontoInicial) { rb.velocity = new Vector3(-playerVel, 0, 0); Invoke("Back2", 0.1f); extremidade = false; point = PlayerPoint.CENTER; } } } }
void Start() { playerPoint = GameObject.FindGameObjectWithTag("PlayerPoint"); playerPointData = playerPoint.GetComponent <PlayerPoint>(); parentRD = transform.parent.transform.parent.GetComponent <RoomData>(); animator = GetComponent <Animator>(); }
void Start() { rb = GetComponent <Rigidbody>(); playerPos = transform.position.x; playerPosY = transform.position.y; extremidade = false; pontoInicial = transform.position.x; swipeL = false; swipeR = false; point = PlayerPoint.CENTER; }
public void OccupyPoint(PlayerPoint point) { for (int i = 0; i < attackPointsList.Length; i++) { if (attackPointsList[i] == point) { attackPointsList[i].occupied = 1; } } for (int i = 0; i < parameterPointsList.Length; i++) { if (parameterPointsList[i] == point) { parameterPointsList[i].occupied = 1; } } }
/// <summary> /// 桌面清空 /// </summary> /// <param name="pos"></param> public void Clear(ShowPoint pos) { switch (pos) { case ShowPoint.Desk: Cards.Clear(); CardUI[] cardUIs = CreatePoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIs.Length; i++) { cardUIs[i].Destroy(); } break; case ShowPoint.Player: PlayerCardList.Clear(); CardUI[] cardUIPlayer = PlayerPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIPlayer.Length; i++) { cardUIPlayer[i].Destroy(); } break; case ShowPoint.ComputerRight: ComputerRightCardList.Clear(); CardUI[] cardUIRight = ComputerRightPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIRight.Length; i++) { cardUIRight[i].Destroy(); } break; case ShowPoint.ComputerLeft: ComputerLeftCardList.Clear(); CardUI[] cardUILeft = ComputerLeftPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUILeft.Length; i++) { cardUILeft[i].Destroy(); } break; default: break; } }
/// <summary> /// Method to save points in a file /// </summary> /// <param name="points">Points to save</param> public void Save(PlayerPoint points) { Load(); playerPoints.Add(points); playerPoints.Sort(); playerPoints.Reverse(); BinaryFormatter bf = new BinaryFormatter(); try { FileStream file = File.Create(fileWay); Data2Save data = new Data2Save(playerPoints); bf.Serialize(file, data); file.Close(); } catch (IOException exception) { Debug.LogError("Error saving: " + exception.Message); } }
private IEnumerator MoveLeft(Transform _t) { if (point == PlayerPoint.CENTER) { point = PlayerPoint.LEFT; Vector3 pos; var t = 0.0f; while (t < 1.0f) { t += Time.fixedDeltaTime / duration; t = Mathf.Clamp01(t); pos = new Vector3(Mathf.Lerp(0, -playerLimit, t), _t.position.y, _t.position.z); _t.position = pos; yield return(new WaitForFixedUpdate()); } } else if (point == PlayerPoint.RIGHT) { point = PlayerPoint.CENTER; Vector3 pos; var t = 0.0f; while (t < 1.0f) { t += Time.fixedDeltaTime / duration; t = Mathf.Clamp01(t); pos = new Vector3(Mathf.Lerp(playerLimit, 0, t), _t.position.y, _t.position.z); _t.position = pos; yield return(new WaitForFixedUpdate()); } } yield return(null); }
public EnemyInfoHolder(GameObject playerOne, PlayerPoint point) { playerGameObject = playerOne; this.point = point; }
// Token: 0x06001E8E RID: 7822 RVA: 0x003A6260 File Offset: 0x003A4460 public override void OnOpen(int arg1, int arg2) { this.DM = DataManager.Instance; this.SM = StringManager.Instance; this.GM = GUIManager.Instance; this.ST = this.DM.mStringTable; Font ttffont = this.GM.GetTTFFont(); this.m_transform = base.transform; this.door = (this.GM.FindMenu(EGUIWindow.Door) as Door); byte b = 1; ushort hiid = 1; this.NameStr = this.SM.SpawnString(30); if (arg1 == 1) { MapPoint mapPoint = DataManager.MapDataController.LayoutMapInfo[arg2]; PlayerPoint playerPoint = DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID]; this.NameStr.Append(playerPoint.playerName); b = playerPoint.allianceRank; hiid = playerPoint.portraitID; GameConstants.MapIDToPointCode(arg2, out this.DesPoint.zoneID, out this.DesPoint.pointID); } else if (arg1 == 2) { AllianceMemberClientDataType allianceMemberClientDataType = this.DM.AllianceMember[arg2]; this.NameStr.Append(allianceMemberClientDataType.Name); b = (byte)allianceMemberClientDataType.Rank; hiid = allianceMemberClientDataType.Head; this.DesPoint = this.DM.AllyMemberLoc; } else if (arg1 == 3) { this.NameStr.Append(this.DM.mLordProfile.PlayerName); b = this.DM.mLordProfile.AlliRank; hiid = this.DM.mLordProfile.Head; this.DesPoint = this.DM.AllyMemberLoc; } else { this.NameStr.Append("TestHelpName"); } this.mBD = this.GM.BuildingData.GetBuildData(17, 0); this.mBR = this.GM.BuildingData.GetBuildLevelRequestData(17, this.mBD.Level); UIButton component = this.m_transform.GetChild(9).GetChild(0).GetComponent <UIButton>(); component.m_Handler = this; component.m_BtnID1 = 1; this.HelpButton = this.m_transform.GetChild(10).GetComponent <UIButton>(); this.HelpButton.m_Handler = this; this.HelpButton.m_BtnID1 = 2; if (this.GM.bOpenOnIPhoneX) { this.m_transform.GetChild(9).GetComponent <Image>().enabled = false; } this.RBText[5] = this.m_transform.GetChild(11).GetComponent <UIText>(); this.RBText[5].font = ttffont; this.RBText[5].text = this.DM.mStringTable.GetStringByID(4040u); this.HelpButtonText = this.HelpButton.transform.GetChild(0).GetComponent <UIText>(); this.HelpButtonText.font = ttffont; this.HelpButtonText.text = this.DM.mStringTable.GetStringByID(4039u); this.HelpButton.m_Text = this.HelpButtonText; this.HelpButton.ForTextChange(e_BtnType.e_ChangeText); this.RBText[6] = this.m_transform.GetChild(12).GetComponent <UIText>(); this.RBText[6].font = ttffont; this.RBText[6].text = this.NameStr.ToString(); UISpritesArray component2 = this.m_transform.GetChild(3).GetComponent <UISpritesArray>(); component2.SetSpriteIndex((int)(b - 1)); if (this.GM.IsArabic) { ((RectTransform)this.m_transform.GetChild(3)).localScale = new Vector3(-1f, 1f, 1f); } GUIManager.Instance.InitianHeroItemImg(this.m_transform.GetChild(4), eHeroOrItem.Hero, hiid, 11, 0, 0, false, false, true, false); this.LTaxText = this.m_transform.GetChild(13).GetComponent <UIText>(); this.LTaxText.font = ttffont; this.TaxStr = this.SM.SpawnString(30); this.TaxText = this.m_transform.GetChild(14).GetComponent <UIText>(); this.TaxText.font = ttffont; this.TaxStr2 = this.SM.SpawnString(30); this.TaxStr2.Length = 0; StringManager.IntToStr(this.TaxStr2, 0L, 1, false); this.TaxText.text = this.TaxStr2.ToString(); this.RBText[7] = this.m_transform.GetChild(15).GetComponent <UIText>(); this.RBText[7].font = ttffont; this.RBText[7].text = this.DM.mStringTable.GetStringByID(4038u); this.LoadingMax = this.GetMaxLoading(); this.LoadingText = this.m_transform.GetChild(16).GetComponent <UIText>(); this.LoadingText.font = ttffont; this.LoadingStr2 = this.SM.SpawnString(30); this.RefreshTax(); this.AddSpeedText = this.m_transform.GetChild(18).GetComponent <UIText>(); this.AddSpeedText.font = ttffont; this.BootsStr = this.SM.SpawnString(30); this.TotalTimeText = this.m_transform.GetChild(17).GetComponent <UIText>(); this.TotalTimeText.font = ttffont; this.TimeStr = this.SM.SpawnString(30); this.RefreshSpeed(); this.m_DResourcesT = this.m_transform.GetChild(19); this.m_DResources = this.m_DResourcesT.GetComponent <DemandResources>(); this.GM.InitDemandResources(this.m_DResourcesT, 489f, 100f, false); for (int i = 0; i < 5; i++) { this.m_DResources.TextResources[i].fontSize = 14; } this.GM.SetDemandResourcesText(this.m_DResources.GetComponent <Transform>(), this.lSendResource); Transform child = this.m_transform.GetChild(20).GetChild(0); for (int j = 0; j < 5; j++) { this.lResource[j] = (long)((ulong)this.DM.Resource[j].Stock); this.ResourcesStr[j] = this.SM.SpawnString(30); Transform child2 = child.GetChild(j); Transform child3 = child2.GetChild(0); Image component3 = child3.GetChild(0).GetComponent <Image>(); component3.sprite = this.GM.m_ItemIconSpriteAsset.LoadSprite((ushort)(1001 + j)); component3.material = this.GM.m_ItemIconSpriteAsset.GetMaterial(); component3 = child3.GetChild(1).GetComponent <Image>(); component3.material = this.GM.GetFrameMaterial(); component3.sprite = this.GM.LoadFrameSprite("if001"); this.RBText[j] = child2.GetChild(1).GetComponent <UIText>(); this.RBText[j].font = ttffont; this.RBText[j].text = this.DM.mStringTable.GetStringByID((uint)(3952 + j)); child3 = child2.GetChild(2); this.GM.InitUnitResourcesSlider(child3, eUnitSlider.MarketHelp, 0u, (uint)this.lResource[j], 0.7f); this.m_Slider[j] = child3.GetComponent <UnitResourcesSlider>(); this.m_Slider[j].m_Handler = this; this.m_Slider[j].m_ID = j; this.m_Slider[j].BtnInputText.m_Handler = this; this.m_Slider[j].BtnInputText.m_BtnID1 = 3; this.m_Slider[j].BtnInputText.m_BtnID2 = j; this.GM.SetUnitResourcesSliderSize(child3, eUnitSliderSize.Input, 85f, 26f, 110f, 26f, 0f, 0f); } if (this.GM.m_OpenResourceMenu) { for (int k = 0; k < 5; k++) { if (this.GM.m_SaveResource[k] > 0u) { this.CheckResource(k, (long)((ulong)this.GM.m_SaveResource[k])); this.SetSlider(k, (long)((ulong)this.GM.m_SaveResource[k])); } } } else { this.GM.m_OpenResourceMenu = true; } this.RefreshResource(false); this.GM.UpdateUI(EGUIWindow.Door, 1, 2); this.bOpen = true; }
/// <summary> /// Method to save points in a file /// </summary> /// <param name="points">Points to save</param> public void Save (PlayerPoint points) { Load(); playerPoints.Add(points); playerPoints.Sort(); playerPoints.Reverse(); BinaryFormatter bf = new BinaryFormatter(); try { FileStream file = File.Create(fileWay); Data2Save data = new Data2Save(playerPoints); bf.Serialize(file, data); file.Close(); } catch (IOException exception) { Debug.LogError("Error saving: " + exception.Message); } }
public static void ReleasePoint(PlayerPoint point) { pointHandler.ReleasePoint(point); }
public static void OccupyPoint(PlayerPoint point) { pointHandler.OccupyPoint(point); }
public static EnemyInfoHolder getInfo4Enemy(Transform enemyPos) { PlayerPoint point = pointHandler.getFreePoint(enemyPos); return(new EnemyInfoHolder(playerOne, point)); }