private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag(playerTag)) { playerController = collision.GetComponent <Player.PlayerController>(); } }
// Use this for initialization void Start() { m_PositionKeyFrames = new KeyframeList<Vector3>(); m_PlayerController = GetComponent<PlayerController>(); }
void Awake() { instance = this; characterController = GetComponent<CharacterController>() as CharacterController; this.indicationTexture = this.indication.GetComponent<AnimateTextureSheet>() as AnimateTextureSheet; this._currentBlock = null; this._currentDirection = PlayerInfo.MovementDirection.NONE; }
private void OnTriggerExit2D(Collider2D collision) { if (collision.CompareTag(playerTag)) { canToggleBetween = false; playerController = null; mainCamera.RevertBack(); } }
private void OnTriggerStay2D(Collider2D collision) { if (collision.CompareTag(playerTag) && canToggleBetween == false) { canToggleBetween = true; playerController = collision.GetComponent <Player.PlayerController>(); mainCamera.StartTransition(lookCameraAtPos); } }
void OnTriggerEnter(Collider collider) { if (collider.GetComponent <Player.PlayerController>() != null) { player = collider.GetComponent <Player.PlayerController>(); player.PowerUps += this.UpdatePickUp; player.ChangeSpeedFactor(SpeedValue); OnPickedUp(); } }
/// <summary> /// This function is called on the first frame the object is spawned /// it stores references to this objects Transform and PawnAABB classes /// grabs the first object in the scene to have a PlayerController script (since only the player should have a PlayerController script) /// it then gets the transform of the player object and stores it in a variable for later use /// </summary> void Start() { enemy = gameObject.GetComponent <Transform>(); enemyBoxCollider = gameObject.GetComponent <BoxCollider>(); Player.PlayerController playerControl = (Player.PlayerController)FindObjectOfType(typeof(Player.PlayerController)); player = playerControl.GetComponent <Transform>(); if (useActivationDistance == false) { isActivated = true; } }
/// <summary> /// This method is called by the PlayerController when this state begins. /// </summary> /// <param name="player">The state-machine driven PlayerController object that called this method.</param> public abstract void OnEnter(PlayerController player);
private void Start() { movementInput = new Vector2(); characterController = gameObject.GetComponent <Player.PlayerController>(); }
void Start() { playerController = GetComponent <Player.PlayerController>(); currentHealth = startingHealth; }
public PlayerData(Player.PlayerController player) { Player = player; elapsedTimeSinceExit = 0f; isExitTimeActive = false; }
/// <summary> /// This method detaches the raft from a PlayerController. /// </summary> public void Detach() { pawn = null; pawn2 = null; }
/// <summary> /// This method is called to attach the raft to a player. /// </summary> /// <param name="player">The PlayerController to attach to.</param> public void Attach(Player.PlayerController player) { pawn = player; transform.rotation = player.GetComponent <Transform>().rotation; }
//c-tor public ConditionController(PlayerController playerController) { m_playerController = playerController; m_ConditionsList = new List<Condition>(); }
/// <summary> /// This method is called by the PlayerController when this state ends. /// </summary> /// <param name="player">The state-machine driven PlayerController object that called this method.</param> public abstract void OnExit(PlayerController player);
/// <summary> /// Assigns a Player object to a photonPlayer /// </summary> /// <param name="playerObject"></param> /// <param name="photonPlayer"></param> public void AssignPlayerObjectToPlayer(PlayerController playerObject, PhotonPlayer photonPlayer) { for (int i = 0; i < m_PlayerInfoList.Count; i++) { if (m_PlayerInfoList[i].PhotonPlayer == null) continue; if (m_PlayerInfoList[i].PhotonPlayer.ID == photonPlayer.ID) { PlayerInfo plInfo = m_PlayerInfoList[i]; if (plInfo.PlayerObject != null) Debug.Log(PhotonNetwork.player.name + " says: I already have a player object, yet I'm assigning one. Is it the same one?"); plInfo.PlayerObject = playerObject; m_PlayerInfoList[i] = plInfo; } } }
// Use this for initialization void Start() { m_OrientationKeyframesList = new KeyframeList<double>(); m_PlayerController = GetComponent<PlayerController>(); }
// Use this for initialization void Start() { m_OrientationKeyframesList = new KeyframeList <double>(); m_PlayerController = GetComponent <PlayerController>(); }
/** * Initialization */ void Awake() { if (!grabBox) { grabBox = new GameObject (); grabBox.name = "GrabSensor"; Collider collider = grabBox.AddComponent<SphereCollider> (); collider.isTrigger = true; grabBox.transform.parent = transform; grabBox.transform.localPosition = new Vector3 (0f, 0f, 1.5f); grabBox.layer = 2; // Ignore raycasts Debug.Log ("Created 'grabBox' for grab sensing"); } playerController = GetComponent<PlayerController> (); actorBody = GetComponent<ActorBody> (); rigidBody = GetComponent<Rigidbody> (); defRotateSpeed = playerController.rotateSpeed; }
public virtual void SetPlayerControllerInstance() { currentPlayerController = GameApplication.Instance.GetService <IBulletService>().GetPlayerControllerInstance(); }
// Use this for initialization void Start() { _player = FindObjectOfType <Player.PlayerController>(); Fill.fillAmount = 0; }
/// <summary> /// This method is called by the PlayerController every tick. /// </summary> /// <param name="player">The state-machine driven PlayerController object that called this method.</param> /// <returns>The new state that the PlayerController should switch to. If null, then remain in this state.</returns> public virtual PlayerState Update(PlayerController player) { this.player = player; return(null); }