private void Awake() { m_PlayerController = FindObjectOfType <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullFindObject <IS_PlayerCharacterController, EnemyManager>(m_PlayerController, this); enemies = new List <EnemyController>(); }
void Awake() { IS_PlayerCharacterController IS_PlayerCharacterController = FindObjectOfType <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullFindObject <IS_PlayerCharacterController, Compass>(IS_PlayerCharacterController, this); m_PlayerTransform = IS_PlayerCharacterController.transform; m_WidthMultiplier = compasRect.rect.width / visibilityAngle; m_heightOffset = -compasRect.rect.height / 2; }
private void Start() { m_IS_PlayerCharacterController = GetComponent <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullGetComponent <IS_PlayerCharacterController, PlayerInputHandler>(m_IS_PlayerCharacterController, this, gameObject); m_GameFlowManager = FindObjectOfType <GameFlowManager>(); DebugUtility.HandleErrorIfNullFindObject <GameFlowManager, PlayerInputHandler>(m_GameFlowManager, this); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
void Start() { IS_PlayerCharacterController IS_PlayerCharacterController = GameObject.FindObjectOfType <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullFindObject <IS_PlayerCharacterController, FollowPlayer>(IS_PlayerCharacterController, this); m_PlayerTransform = IS_PlayerCharacterController.transform; m_OriginalOffset = transform.position - m_PlayerTransform.position; }
void Start() { m_Player = FindObjectOfType <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullFindObject <IS_PlayerCharacterController, GameFlowManager>(m_Player, this); m_ObjectiveManager = FindObjectOfType <ObjectiveManager>(); DebugUtility.HandleErrorIfNullFindObject <ObjectiveManager, GameFlowManager>(m_ObjectiveManager, this); AudioUtility.SetMasterVolume(1); }
private void OnTriggerEnter(Collider other) { IS_PlayerCharacterController pickingPlayer = other.GetComponent <IS_PlayerCharacterController>(); if (pickingPlayer != null) { if (onPick != null) { onPick.Invoke(pickingPlayer); } } }
void OnPicked(IS_PlayerCharacterController player) { Health playerHealth = player.GetComponent <Health>(); if (playerHealth && playerHealth.canPickup()) { playerHealth.Heal(healAmount); m_Pickup.PlayPickupFeedback(); Destroy(gameObject); } }
void Start() { isJetpackUnlocked = isJetpackUnlockedAtStart; m_IS_PlayerCharacterController = GetComponent <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullGetComponent <IS_PlayerCharacterController, Jetpack>(m_IS_PlayerCharacterController, this, gameObject); m_InputHandler = GetComponent <IS_PlayerInputHandler>(); DebugUtility.HandleErrorIfNullGetComponent <IS_PlayerInputHandler, Jetpack>(m_InputHandler, this, gameObject); currentFillRatio = 1f; audioSource.clip = jetpackSFX; audioSource.loop = true; }
void OnPickup(IS_PlayerCharacterController player) { if (m_Objective.isCompleted) { return; } // this will trigger the objective completion // it works even if the player can't pickup the item (i.e. objective pickup healthpack while at full heath) m_Objective.CompleteObjective(string.Empty, string.Empty, "Objective complete : " + m_Objective.title); if (gameObject) { Destroy(gameObject); } }
void OnPicked(IS_PlayerCharacterController byPlayer) { var jetpack = byPlayer.GetComponent <Jetpack>(); if (!jetpack) { return; } if (jetpack.TryUnlock()) { m_Pickup.PlayPickupFeedback(); Destroy(gameObject); } }
private void Start() { InputUser.CreateUserWithoutPairedDevices(); if (MenuManager) { MenuManager.gameObject.SetActive(false); } m_IS_PlayerCharacterController = GetComponent <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullGetComponent <IS_PlayerCharacterController, IS_PlayerInputHandler>(m_IS_PlayerCharacterController, this, gameObject); m_GameFlowManager = FindObjectOfType <GameFlowManager>(); DebugUtility.HandleErrorIfNullFindObject <GameFlowManager, IS_PlayerInputHandler>(m_GameFlowManager, this); if (currentKeyboard != null) { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } ToggleGameplayInput(true); }
void OnPicked(IS_PlayerCharacterController byPlayer) { IS_PlayerWeaponsManager IS_PlayerWeaponsManager = byPlayer.GetComponent <IS_PlayerWeaponsManager>(); if (IS_PlayerWeaponsManager) { if (IS_PlayerWeaponsManager.AddWeapon(weaponPrefab)) { // Handle auto-switching to weapon if no weapons currently if (IS_PlayerWeaponsManager.GetActiveWeapon() == null) { IS_PlayerWeaponsManager.SwitchWeapon(true); } m_Pickup.PlayPickupFeedback(); Destroy(gameObject); } } }
private void Start() { activeWeaponIndex = -1; m_WeaponSwitchState = WeaponSwitchState.Down; m_InputHandler = GetComponent <PlayerInputHandler>(); DebugUtility.HandleErrorIfNullGetComponent <PlayerInputHandler, IS_PlayerWeaponsManager>(m_InputHandler, this, gameObject); m_IS_PlayerCharacterController = GetComponent <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullGetComponent <IS_PlayerCharacterController, IS_PlayerWeaponsManager>(m_IS_PlayerCharacterController, this, gameObject); SetFOV(defaultFOV); onSwitchedToWeapon += OnWeaponSwitched; // Add starting weapons foreach (var weapon in startingWeapons) { AddWeapon(weapon); } SwitchWeapon(true); }
void Awake() { m_IS_PlayerCharacterController = FindObjectOfType <IS_PlayerCharacterController>(); DebugUtility.HandleErrorIfNullFindObject <IS_PlayerCharacterController, TeleportPlayer>(m_IS_PlayerCharacterController, this); }