Unity Harvesting

Introduction

The SyncListHarvesterTree is a class in the Unity engine that provides a synchronized list of HarvesterTreeInstance objects across the network in real-time. It is used in conjunction with the NetworkBehaviour component to ensure that all clients are aware of the state of the list and can interact with it accordingly.

The SyncListHarvesterTree class automatically handles the synchronization of the list across all clients in the network. Any time an object is added or removed from the list, all clients are notified and the appropriate changes are made to ensure that the list is kept in sync. This is important for maintaining consistency between different instances of the game running on different machines, as well as for providing a smooth and seamless experience for all players.

Overall, the SyncListHarvesterTree is an important component of any networked game that involves the manipulation of lists of objects, particularly in scenarios where real-time synchronization is necessary for gameplay. By automating the process of synchronization and providing a high degree of flexibility, it makes it easy for developers to create engaging and immersive networked games with minimal effort.

Overview

SyncListHarvesterTree is a class used to store information about trees that have been harvested in a Unity game. The class is used to keep track of the tree’s properties, such as color, height, position, rotation, and width scale.

Interface

SyncListHarvesterTree has no implemented interface.

Constructors

SyncListHarvesterTree has no constructors defined.

Methods

SyncListHarvesterTree has no methods defined.

Properties

Property Type Summary
color Color32 The color of the harvested tree.
currentTime float The time that the tree was added to the list.
explosionPosition Vector3 The position of the tree after it has been exploded.
harvestingRestoreTime float The time it takes for the tree to respawn after being harvested.
height float The height of the harvested tree.
lightmapColor Color32 The lightmap color of the harvested tree.
position Vector3 The position of the harvested tree in the world.
prototypeIndex int The index of the harvested tree’s prefab in the terrain.
rotation float The rotation of the harvested tree.
terrainInstanceId int The unique identifier for the terrain instance where the tree was harvested.
terrainInstanceName string The name of the terrain instance where the tree was harvested.
widthScale float The width scale of the harvested tree.

Events

SyncListHarvesterTree has no events defined.

Concepts/Guides

SyncListHarvesterTree is used in conjunction with the HarvesterTreeInstance class to keep track of the trees that have been harvested in a game. The information stored in SyncListHarvesterTree is used to respawn the trees after they have been harvested.

Examples

SyncListHarvesterTree is typically used in a Unity game engine where it is necessary to keep track of the trees that have been harvested by the player.

Unity Usage

SyncListHarvesterTree is typically used in conjunction with other classes and objects in a Unity game engine. It is used to store information about the trees that have been harvested, such as their position, rotation, color, and width scale. This information is used to respawn the trees after they have been harvested.