private HomeCharacterBase CreateChara(WayPoint way_point) { FriendCharaInfo chara_info = null; if (Random.Range(0, 1) == 0) { List <FriendCharaInfo> chara = MonoBehaviourSingleton <FriendManager> .I.homeCharas.chara; int count = chara.Count; if (count > 0) { int num = Random.Range(0, count); int num2 = num; do { FriendCharaInfo info = chara[num2]; if (info != null && !(charas.Find((HomeCharacterBase o) => o.GetFriendCharaInfo() != null && o.GetFriendCharaInfo().userId == info.userId) != null)) { chara_info = info; break; } num2 = (num2 + 1) % count; }while (num != num2); } } HomeCharacterBase homeCharacterBase = creater.CreatePlayer(this, peopleRoot, chara_info, way_point); charas.Add(homeCharacterBase); return(homeCharacterBase); }
private IEnumerator LocateHomePeople() { MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.SetupNPCSituations(); OutGameSettingsManager.HomeScene.NPC[] npcs = MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.npcs; foreach (OutGameSettingsManager.HomeScene.NPC npc in npcs) { HomeCharacterBase chara = creater.CreateNPC(this, peopleRoot, npc); if (chara != null) { charas.Add(chara); } } groupCenterPos = new Vector3(0f, -1f, 0f); if (Random.Range(0, 8) == 0) { int num2 = Random.Range(2, 5); List <HomeCharacterBase> list = new List <HomeCharacterBase>(); for (int k = 0; k < num2; k++) { list.Add(CreateChara(centerPoint)); } groupCenterPos = list[0]._transform.get_localPosition(); float angle_step = 360f / (float)num2; float angle = Random.get_value() * 360f; Vector3 DIST = new Vector3(0f, 0f, 1f); int j = 0; while (j < num2) { Transform t = list[j]._transform; t.set_localPosition(Quaternion.AngleAxis(angle, Vector3.get_up()) * DIST + groupCenterPos); t.LookAt(groupCenterPos); list[j].StopDiscussion(); j++; angle += angle_step; } } else { int num = Random.Range(1, 5); if (!TutorialStep.IsTheTutorialOver(TUTORIAL_STEP.ENTER_FIELD_03)) { num = 0; } for (int i = 0; i < num; i++) { CreateChara(centerPoint); } } while (IsLoadingCharacter()) { yield return((object)null); } }
private Vector3 GetLoungeMoveNPCTargetPosition(HomeCharacterBase chara, WayPoint wayPoint) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!(chara is LoungeMoveNPC)) { return(wayPoint.GetPosInCollider()); } Vector2 vector = wayPoint.GetPosInCollider().ToVector2XZ(); return(vector.ToVector3XZ()); }
private IEnumerator SetupGuild() { MonoBehaviourSingleton <OutGameSettingsManager> .I.guildScene.SetupNPCSituations(); OutGameSettingsManager.GuildScene.NPC[] npcs = MonoBehaviourSingleton <OutGameSettingsManager> .I.guildScene.npcs; foreach (OutGameSettingsManager.GuildScene.NPC npc in npcs) { HomeCharacterBase chara = creater.CreateNPC(this, peopleRoot, npc); if (chara != null) { charas.Add(chara); } } while (IsLoadingCharacter()) { yield return((object)null); } isInitialized = true; isPeopleInitialized = true; }
private void OnTap(InputManager.TouchInfo info) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (IsEnableControl()) { HomeCamera homeCamera = null; if (MonoBehaviourSingleton <HomeManager> .IsValid()) { homeCamera = MonoBehaviourSingleton <HomeManager> .I.HomeCamera; } else if (MonoBehaviourSingleton <LoungeManager> .IsValid()) { homeCamera = MonoBehaviourSingleton <LoungeManager> .I.HomeCamera; } else if (MonoBehaviourSingleton <GuildStageManager> .IsValid()) { homeCamera = MonoBehaviourSingleton <GuildStageManager> .I.HomeCamera; } if (homeCamera.viewMode == HomeCamera.VIEW_MODE.NORMAL) { HomeCharacterBase homeCharacterBase = null; HomeStageTouchEvent homeStageTouchEvent = null; if (targetEvent != null) { targetEvent.DispatchEvent(); } else if (targetChara != null) { homeCharacterBase = targetChara; } else { Ray val = default(Ray); if (MonoBehaviourSingleton <HomeManager> .IsValid() || MonoBehaviourSingleton <LoungeManager> .IsValid() || MonoBehaviourSingleton <GuildStageManager> .IsValid()) { val = homeCamera.targetCamera.ScreenPointToRay(Vector2.op_Implicit(info.position)); } RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 100f, 259)) { homeCharacterBase = val2.get_transform().GetComponent <HomeCharacterBase>(); homeStageTouchEvent = val2.get_transform().GetComponent <HomeStageTouchEvent>(); } } if (homeCharacterBase != null) { if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible()) { if (homeCharacterBase is HomeNPCCharacter) { lastTargetNPCID = ((HomeNPCCharacter)homeCharacterBase).npcInfo.npcID; } else { lastTargetNPCID = 0; } if (homeCharacterBase.DispatchEvent()) { homeCharacterBase.StopMoving(); } } } else if (homeStageTouchEvent != null) { homeStageTouchEvent.DispatchEvent(); } } } }
private void LateUpdate() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) int i = 0; for (int count = charas.Count; i < count; i++) { HomeCharacterBase homeCharacterBase = charas[i]; if (!homeCharacterBase.isLoading && homeCharacterBase.get_isActiveAndEnabled()) { Vector2 val = homeCharacterBase._transform.get_localPosition().ToVector2XZ(); HomeCharacterBase homeCharacterBase2 = null; float num = 9f; Vector2 val2 = default(Vector2); val2._002Ector(0f, 0f); Vector2 val3 = default(Vector2); val3._002Ector(0f, 0f); for (int j = i + 1; j < count; j++) { HomeCharacterBase homeCharacterBase3 = charas[j]; if (!homeCharacterBase3.isLoading && homeCharacterBase3.get_isActiveAndEnabled()) { Vector2 val4 = homeCharacterBase3._transform.get_localPosition().ToVector2XZ(); Vector2 val5 = val - val4; float sqrMagnitude = val5.get_sqrMagnitude(); if (sqrMagnitude > 0f && sqrMagnitude < num) { homeCharacterBase2 = homeCharacterBase3; val3 = val4; val2 = val5; num = sqrMagnitude; } } } if (homeCharacterBase2 != null) { float num2 = Mathf.Sqrt(num); Vector2 val6 = val2 / num2; float num3 = 1f - num2 / 3f; num3 = num3 * Time.get_deltaTime() * 0.9f; if (num3 > 0.5f) { num3 = 0.5f; } Vector2 val7 = val6 * num3; if (!homeCharacterBase.isStop) { homeCharacterBase._transform.set_localPosition((val + val7).ToVector3XZ()); } if (!homeCharacterBase2.isStop) { homeCharacterBase2._transform.set_localPosition((val3 - val7).ToVector3XZ()); } } } } }
public void OnDestroyHomeCharacter(HomeCharacterBase chara) { charas.Remove(chara); }
public Vector3 GetTargetPos(HomeCharacterBase chara, WayPoint wayPoint) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) if (MonoBehaviourSingleton <LoungeManager> .IsValid()) { return(GetLoungeMoveNPCTargetPosition(chara, wayPoint)); } float num = 1.5f; num *= num; bool flag = groupCenterPos.y != -1f; Vector2 val = groupCenterPos.ToVector2XZ(); for (int i = 0; i < 8; i++) { Vector2 val2 = wayPoint.GetPosInCollider().ToVector2XZ(); if (flag) { Vector2 val3 = val2 - val; if (val3.get_sqrMagnitude() < num) { continue; } } int j = 0; int count; for (count = charas.Count; j < count; j++) { HomeCharacterBase homeCharacterBase = charas[j]; if (homeCharacterBase != chara && !homeCharacterBase.isLoading && homeCharacterBase.get_isActiveAndEnabled()) { Vector2 val4 = val2 - homeCharacterBase.moveTargetPos.ToVector2XZ(); if (val4.get_sqrMagnitude() < 0.25f) { break; } } } if (j == count) { return(val2.ToVector3XZ()); } } return(wayPoint.GetPosInCollider()); }