public void SetObjectiveItemInfo(ObjectiveItem _itemInfo) { if (_itemInfo == ObjectiveItem.off) { ObjectiveItemUI.SetActive(false); } // set PNG here. }
public ObjectiveItem CreateEmptyObjectiveItem() { var item = new ObjectiveItem(Base.LayerType); RegisterObjectiveItemForCollection(item.ItemCast); return(item); }
private ObjectiveItem ReadObjectives(SqlDataReader reader) { var objective = new ObjectiveItem(); objective.ObjectiveDescription = reader["ObjectiveDescription"].ToString(); return(objective); }
private IEnumerator MoveObject(ObjectiveItem objectiveItem, float speed) { float t = 0; while (t < 1) { t += Time.deltaTime * speed; objectiveItem.placedObject.transform.position = Vector3.Lerp(objectiveItem.placedObject.transform.position, objectiveItem.finalPosition.position, t); yield return(new WaitForEndOfFrame()); } yield return(null); }
private void OnTriggerEnter(Collider col) { ObjectiveItem item = IsItemAnObjective(col.transform.gameObject); if (item != null && MoveableManager.Instance.holding == null) { MoveableObject moveableObject = col.GetComponent <MoveableObject>(); col.transform.rotation = moveableObject.defaultRotation; Destroy(moveableObject); Destroy(col.GetComponent <Collider>()); col.gameObject.layer = 8; Destroy(col.GetComponent <Rigidbody>()); StartCoroutine(MoveObject(item, animationSpeed)); } }
public int Compare(ObjectiveItem <T> x, ObjectiveItem <T> y) { if (ReferenceEquals(x, y)) { return(0); } else if (x is null) { return(-1); } else if (y is null) { return(+1); } if (!ReferenceEquals(x.Owner, y.Owner)) { return(0); } int result = x.FrontierLevel.CompareTo(y.FrontierLevel); if (result < 0) { return(1); } else if (result > 0) { return(-1); } result = x.CrowdingDistance.CompareTo(y.CrowdingDistance); if (result != 0) { return(result); } return(0); }
public void PlaceObjectives() { // While there are still objective items to spawn: while (objectiveItemList.Count > 0) { // Select a random spawn point on a random floor: Floor randomFloor = SelectRandomFloor(); ItemSpawnPoint randomSpawnPoint = SelectRandomSpawnPoint(randomFloor); if (randomSpawnPoint != null) { // Spawn the item: ObjectiveItem currentItem = objectiveItemList[Random.Range(0, objectiveItemList.Count)]; Instantiate(currentItem, randomSpawnPoint.transform.position, randomSpawnPoint.transform.rotation, randomSpawnPoint.transform); randomFloor.itemSpawnPoints.Remove(randomSpawnPoint); objectiveItemList.Remove(currentItem); spawnedObjectives.Add(currentItem); } else if (randomSpawnPoint == null) { // Do nothing. The while loop will continue running until it finds an available spawn point. Debug.Log("Floor has no available spawn points. Trying another floor."); } } // Spawn a single keycard somewhere in the level for access to locked rooms: Floor randomFloor2 = SelectRandomFloor(); ItemSpawnPoint randomSpawnPoint2 = SelectRandomSpawnPoint(randomFloor2); Keycard keycard = keycardPrefab; Instantiate(keycardPrefab, randomSpawnPoint2.transform.position, randomSpawnPoint2.transform.rotation, randomSpawnPoint2.transform); randomFloor2.itemSpawnPoints.Remove(randomSpawnPoint2); spawnedKeycards.Add(keycard); }
public PlayerPanelInfo(PlayerPanelOrientation _orientation, ObjectiveItem _item) { _playerPanel = _orientation; _objectiveItem = _item; }