public void LevelEvent()
    {
        if (evented)
        {
            return;
        }

        evented = true;

        // If debugging unlink player partner.
        if (/*debugEvent && player != null && */ player.Partner != null)
        {
            WaypointSeek partnerSeek = player.Partner.GetComponent <WaypointSeek>();
            if (partnerSeek != null)
            {
                partnerSeek.moveWithoutPartner = true;
            }
            player.Partner.seekingPartner = false;
            //player.Partner.fading = true;
            ConversationManager.Instance.EndConversation(player, player.Partner);
        }

        // Update the looping boundary.
        boundary.ChangeWorldSize(worldWidth, worldHeight);
        boundary.transform.Translate(worldOffset);

        // Enable specified objects for looping.
        for (int i = 0; i < enableObjects.Count; i++)
        {
            LoopTag loopTag = enableObjects[i].GetComponent <LoopTag>();
            if (loopTag)
            {
                loopTag.stayOutsideBounds = false;
                loopTag.passThrough       = false;
                loopTag.trackObject       = true;
            }
            WaypointSeek waypointSeek = enableObjects[i].GetComponent <WaypointSeek>();
            if (waypointSeek)
            {
                waypointSeek.moveWithoutPartner = true;
            }
        }

        // Disable specified object for looping.
        for (int i = 0; i < disableObjects.Count; i++)
        {
            LoopTag loopTag = disableObjects[i].GetComponent <LoopTag>();
            if (loopTag)
            {
                loopTag.stayOutsideBounds = true;
                loopTag.passThrough       = true;
                loopTag.trackObject       = false;
            }
        }
    }
Пример #2
0
 public void RespondTransgression()
 {
     targetTransgressions++;
     if (targetTransgressions >= transgressionThreshold)
     {
         OneWayPartner follow = GetComponent <OneWayPartner>();
         if (follow != null)
         {
             follow.followTarget = true;
         }
         WaypointSeek seek = GetComponent <WaypointSeek>();
         if (seek != null)
         {
             seek.orbit = true;
         }
     }
 }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     partnerLink = GetComponent <PartnerLink>();
     seeker      = GetComponent <WaypointSeek>();
 }
	// Use this for initialization
	void Start () {
		partnerLink = GetComponent<PartnerLink>();
		seeker = GetComponent<WaypointSeek>();
	}