public void NextNode(int index)
    {
        if (!ConversationModeOn)
        {
            return;
        }

        if (index == -1)
        {
            //exit system
            ConversationModeOn = false;
            //in case an unclosed end, send again
            //Space.DispatchEvent(Events.EndConversation);
            //Space.DispatchEvent(Events.CloseUI, new UIEvent(this));

            Converse    = null;
            CurrentNode = null;

            //if (UIControl.IsOpened())
            // Space.DispatchEvent(Events.CloseDescription);

            //print(UIControl.IsOpened());

            return;
        }
        CurrentNode = Converse.GetNode(index);
        NodeIndex   = index;

        NextAction();
    }
Example #2
0
 void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Example #3
0
    public void EndConversation()
    {
        conversationCam.enabled = false;

        currentConversation          = null;
        currentConversationData      = null;
        currentCameraAction          = null;
        CurrentCameraActionCoroutine = null;
    }
Example #4
0
    //public Animator anim;

    public void StartDialogue(Audiodialog a)
    {
        conversationSystem = GetComponent <ConversationSystem>();
        //questManager = GameObject.Find("Quest Manager").GetComponent<QuestManager>();
        conversating = true;
        startConvo   = true;

        audiodialog = a;
    }
Example #5
0
 private void InitializeConversationSystem()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Example #6
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
    public void OnStart(ConversationEvent eventdata)
    {
        ConversationModeOn = true;
        //Space.DispatchEvent(Events.OpenUI, new UIEvent(this));
        Converse = eventdata.conversation;
        //interuptFlags = new List<ConvInteruprt>();
        //InteruptFailNode = 0;
        // PhoneInterupt = false;
        //ExaminedItem = false;
        //ExamineInterupt = false;
        //ItemExamined = null;

        NextNode(0);
        //print("on");
    }
Example #8
0
    //----------------------------------------------------------------------------------------------

    void Awake()
    {
        textBoxSprite = GetComponent <SpriteRenderer>().sprite;
        spriteRen     = GetComponent <SpriteRenderer>();

        conversationSystem = GetComponent <ConversationSystem>();

        minX = transform.position.x - spriteRen.size.x / 2 + textBoxSprite.border.x / textBoxSprite.pixelsPerUnit; //border.x = left
        maxX = transform.position.x + spriteRen.size.x / 2 - textBoxSprite.border.z / textBoxSprite.pixelsPerUnit; //border.z = right

        minY = transform.position.y - spriteRen.size.y / 2 + textBoxSprite.border.y / textBoxSprite.pixelsPerUnit; //border.y = bottom
        maxY = transform.position.y + spriteRen.size.y / 2 - textBoxSprite.border.w / textBoxSprite.pixelsPerUnit; //border.w = top

        writingOptions = false;
        //StartWriting(true, false, indentationX, Dialogue);
    }
Example #9
0
 public void ImportConversation(ConversationSystem newConversation)
 {
     currentConversation = newConversation;
 }
 public void OnStart(ConversationEvent eventdata)
 {
     TimeCheck = eventdata.conversation;
     NextNode(0);
 }
 public ConversationEvent(string conversationSource, GameObject caller_ = null)
 {
     conversation = new ConversationSystem(TextParser.ToJson(conversationSource));
 }
 public ConversationEvent(TextAsset conversationSource)
 {
     conversation = new ConversationSystem(TextParser.ToJson(conversationSource));
 }
 public ConversationEvent(JsonData conversationSource)
 {
     conversation = new ConversationSystem(conversationSource);
 }