void Start() { _npcCentral = GetComponent <NpcCentral>(); if (!_npcCentral) { Debug.Log("No NpcCentral here!"); } _inputManager = FindObjectOfType <InputManager>().GetComponent <InputManager>(); if (!_inputManager) { Debug.Log("No InputManager found!"); } if (_npcCentral.GetConvinced()) { GameObject response = Instantiate(_response, transform.position, Quaternion.identity); response.transform.parent = transform; } _gameData = FindObjectOfType <GameData>().GetComponent <GameData>(); }
void Start() { _rb = gameObject.GetComponent <Rigidbody2D>(); if (!_rb) { Debug.Log("No RigidBody2D here!"); } _npcCentral = GetComponent <NpcCentral>(); if (!_npcCentral) { Debug.Log("No NpcCentral here!"); } _player = FindObjectOfType <PlayerWalk>().gameObject; if (!_player) { Debug.Log("No Player in scene!"); } _offset += Random.Range(0, 4); }