private void MoveWeaponLocation(CharacterResourceManager.Cards weapon, CharacterResourceManager.Cards room) { Vector3 location = CharacterResourceManager.RoomLocation(room) + RandomXZVector(0.5f, 1f); if (weaponObjects == null || !weaponObjects.ContainsKey(weapon)) { if (weaponObjects == null) { weaponObjects = new Dictionary <CharacterResourceManager.Cards, GameObject>(); } GameObject gameObject = Instantiate(GetWeaponPrefab(weapon), location, Quaternion.identity); weaponObjects[weapon] = gameObject; } else { weaponObjects[weapon].transform.position = location; } weaponObjects[weapon].transform.Rotate(0, UnityEngine.Random.Range(0, 360f), 0); }
private void Moving() { if (isSelected) { if (isMoving) { GameObject player = ClueData.Instance.GetPlayerGameObject(turnManager.CurrentTurn - 1); player.transform.position += (targetPosition - player.transform.position) / 25f; if ((targetPosition - player.transform.position).magnitude < (boardManager.TileWidth / 30f)) { player.transform.position = targetPosition; isMoving = false; } } else { if (IsEntrance(ClueData.Instance.GetPlayerRowCol(turnManager.CurrentTurn - 1))) { humanCardsDisplay.HideAll(); characterGuessParent.SetActive(true); isSelected = false; isMoving = false; CharacterResourceManager.Cards room = GetEntranceRoom(ClueData.Instance.GetPlayerRowCol(turnManager.CurrentTurn - 1)); guessRoom = room; ClueData.Instance.GetPlayerGameObject(turnManager.CurrentTurn - 1).transform.position = CharacterResourceManager.RoomLocation(room); turnState = TurnState.ChoosingGuessCharacter; } else { turnState = TurnState.PostTurn; } } } else if (!IsCurrentTurnHuman()) { aiTimer += Time.deltaTime; if (aiTimer >= 1) { aiTimer = 0; SelectTile(AIChooseSpot()); } } }