// Start is called before the first frame update
    void Start()
    {
        bc                 = GameObject.FindWithTag("BlackboardController").GetComponent <BlackboardController>();
        playerStats        = (PlayerStatsVariable)bc.GetBlackboardValue("PlayerStats");
        transform.position =
            new Vector3(playerStats.playerPosition.x, transform.position.y, playerStats.playerPosition.z);

        cc  = GetComponent <CharacterController>();
        cam = Camera.main.transform;
    }
Пример #2
0
    // Start is called before the first frame update
    private void Start()
    {
        closedPos = transform.position;
        openPos   = closedPos - new Vector3(2f, 0f, 0f);
        bc        = GameObject.FindWithTag("BlackboardController").GetComponent <BlackboardController>();

        bc.StartListening(blackboardEventName, OnDoorToggle);

        OnDoorToggle(bc.GetBlackboardValue(blackboardEventName));
    }
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        LoadBlackboardState();
    }
Пример #4
0
    private void OnEnable()
    {
        bbctrl = (BlackboardController)target;
        RefreshBlackboard();

        Undo.undoRedoPerformed += delegate
        {
            if (bb == null)
            {
                return;
            }

            RefreshFoldoutsList();
            RefreshReordableLists();
        };
    }
Пример #5
0
 private void Start()
 {
     bc = GameObject.FindWithTag("BlackboardController").GetComponent <BlackboardController>();
 }