override public void RemoveDetector(InteractionDetector detector) { if (originalItem != null) { originalItem.RemoveDetector(detector); } }
// Use this for initialization void Start() { player = transform.GetComponent <Player> (); if (player == null) { throw new UnityException("No Player found in Interaction Manager"); } guiManager = player.GetGUIManager(); if (guiManager == null) { throw new UnityException("No GUIManager found in Interaction Manager"); } detector = player.GetDetector(); if (detector == null) { throw new UnityException("No Interaction Detector set in Interaction Manager"); } playerController = player.GetPlayerController(); if (playerController == null) { throw new UnityException("No Player Controller set in Interaction Manager"); } listController = new ListController(guiManager); }
private void Awake() { noPlayerPhases = GameObject.Find("Managers").GetComponent <GameManager>().noPlayerPhases; playerController = Player.GetComponent <PlayerController>(); footStepsScript = Player.GetComponent <footSteps>(); interactionDetector = GameObject.Find("Input").GetComponent <InteractionDetector>(); animator = Player.GetComponent <Animator>(); }
private void Start() { camera = Camera.main; inventory = Inventory.GetInstance(); intDetector = InteractionDetector.GetInstance(); weaponSwapDelaySeconds = new WaitForSeconds(weaponSwapDelay); firing = false; }
void Start() { playerRigidbody = GetComponent <Rigidbody>(); interactableDetector = GetComponentInChildren <InteractionDetector>(); customGravity = GetComponent <CustomGravity>(); InvokeRepeating("GroundCheck", 0, checkRateForGround); }
private void Awake() { gamePausing = GameObject.Find("Managers").GetComponent <GamePausing>(); interactionDetector = GameObject.Find("Input").GetComponent <InteractionDetector>(); propsCam.enabled = false; UIprops.SetActive(false); UImain.SetActive(true); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
protected override void DoAwake() { // Debug.Log("PlayerInputDefaultState.DoAwake()"); base.DoAwake(); movement = GetComponentInChildren <PlayerMovement>(); playerView = GetComponentInChildren <PlayerView>(); interactionDetector = GetComponentInChildren <InteractionDetector>(); pickupHolder = GetComponentInChildren <PickupHolder>(); photo = GetComponentInChildren <Photo>(); // gameStateMachine = FindObjectOfType<GameStateTitleScreen>().GetComponent<StateMachine>(); EventBus.Subscribe <EnterTitleScreenEvent>(e => canPause = false); EventBus.Subscribe <PhotoLoweredAtStartEvent>(e => canPause = true); EventBus.Subscribe <ObjectiveCompletedCutsceneStartEvent>(e => canPause = false); EventBus.Subscribe <ObjectiveCompletedCutsceneEndEvent>(e => canPause = true); EventBus.Subscribe <PlayerHasWonEvent>(e => canPause = false); }
private void Start() { interactionDetector = GetComponent <InteractionDetector>(); EventBus.Subscribe <DropItemTriggerEvent>(OnDropItemTriggerEvent); }
virtual public void RemoveDetector(InteractionDetector detector) { this.detector = null; }
virtual public void AddDetector(InteractionDetector detector) { this.detector = detector; }
virtual protected void Start() { detector = null; actionList = new ActionList(false); }