Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Fungus;
- public class FungusBlockTrigger : MonoBehaviour
- {
- [SerializeField] string blockToStart = "";
- [SerializeField] Flowchart flowchart = null;
- public bool inConversation = false;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- inConversation = flowchart.HasExecutingBlocks();
- }
- public void OnTriggerEnter2D(UnityEngine.Collider2D collided)
- {
- if (!inConversation && collided.gameObject.name == "Player" && blockToStart != "")
- {
- flowchart.ExecuteBlock(blockToStart);
- }
- }
- public void SetBlockToStart (string blockName)
- {
- blockToStart = blockName;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement