コード例 #1
0
 /// <summary>
 /// This sets a reference to the Camera component.
 /// </summary>
 void Start()
 {
     cam = GetComponentInChildren <Camera>();
     if (target)
     {
         trackDataSrc = target.GetComponent <AlignWithPath>();
     }
 }
コード例 #2
0
    /// <summary>
    /// This is fired when an object enters the volume.
    /// </summary>
    /// <param name="collider">The collider that entered the volume.</param>
    void OnTriggerEnter(Collider collider)
    {
        AlignWithPath controller = collider.GetComponent <AlignWithPath>();

        if (controller && node) // if the other object has an AlignWithPath node, switch its current node.
        {
            controller.currentNode = node;
        }
    }