protected override void OnFinish()
        {
            Debug.Log("Finishing in catalogue");
            //have the librarian talk to the player
            base.OnFinish();
            if (PlacedOrder | ReceivedOrder)
            {
                //if (string.IsNullOrEmpty(library.LibrarianCharacterName)) {
                //Debug.Log("Setting defaults in catalogue");
                library.SetDefaults();
                //}
                Character character = null;
                if (Characters.Get.SpawnedCharacter(library.LibrarianCharacterName, out character))
                {
                    Debug.Log("We got librarian character name");
                    character.LookAtPlayer();
                    if (ReceivedOrder && !gReceivedOrderOnceThisSession)
                    {
                        gReceivedOrderOnceThisSession = true;

                        NGUIScreenDialog.AddSpeech(library.LibrarianDTSOnReceivedOrder.Replace("{motto}", library.Motto), character.worlditem.DisplayName, 2f);
                    }
                    else if (!gPlacedOrderOnceThisSession)
                    {
                        gPlacedOrderOnceThisSession = true;
                        NGUIScreenDialog.AddSpeech(library.LibrarianDTSOnPlacedOrder.Replace("{motto}", library.Motto), character.worlditem.DisplayName, 2f);
                    }
                }
                else
                {
                    Debug.Log("Couldn't find character " + library.LibrarianCharacterName);
                    if (ReceivedOrder && !gReceivedOrderOnceThisSession)
                    {
                        gReceivedOrderOnceThisSession = true;
                        NGUIScreenDialog.AddSpeech(library.LibrarianDTSOnReceivedOrder.Replace("{motto}", library.Motto), "Librarian", 2f);
                    }
                    else if (!gPlacedOrderOnceThisSession)
                    {
                        gPlacedOrderOnceThisSession = true;
                        NGUIScreenDialog.AddSpeech(library.LibrarianDTSOnPlacedOrder.Replace("{motto}", library.Motto), "Librarian", 2f);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void WakeUp()
        {
            base.WakeUp();

            Get = this;
        }