示例#1
0
        /// <summary>
        /// Initialises this <see cref="HashNode"/>, assigning it an origin position and picking its initial target position
        /// </summary>
        /// <param name="origin">The origin position which this <see cref="HashNode"/> will be anchored to</param>
        public void Initialise(Vector3 origin)
        {
            //Set the initial size of this node
            NodeSize = MINIMUM_SIZE;
            transform.localScale = Vector3.one * NodeSize;

            //Save the origin position for this node
            originPosition = origin;

            //Set an initial target
            nextTarget = originPosition + new Vector3(Random.Range(-3, 3), Random.Range(-3, 3), Random.Range(-3, 3));

            //Initialise the visibility of this node to be opaque
            SetVisibility(1);

			//Set the AudioSource reference to the attached AudioSource script
			source = AudioSourceManager.GetNextSource(origin);
        }