Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag(playerTag))
     {
         playerController = collision.GetComponent <Player.PlayerController>();
     }
 }
Example #2
0
        // Use this for initialization
        void Start()
        {

            m_PositionKeyFrames = new KeyframeList<Vector3>();
            m_PlayerController  = GetComponent<PlayerController>();

        }
Example #3
0
        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;            
        }
Example #4
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.CompareTag(playerTag))
     {
         canToggleBetween = false;
         playerController = null;
         mainCamera.RevertBack();
     }
 }
Example #5
0
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.CompareTag(playerTag) && canToggleBetween == false)
     {
         canToggleBetween = true;
         playerController = collision.GetComponent <Player.PlayerController>();
         mainCamera.StartTransition(lookCameraAtPos);
     }
 }
Example #6
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.GetComponent <Player.PlayerController>() != null)
        {
            player           = collider.GetComponent <Player.PlayerController>();
            player.PowerUps += this.UpdatePickUp;
            player.ChangeSpeedFactor(SpeedValue);

            OnPickedUp();
        }
    }
Example #7
0
 /// <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;
     }
 }
Example #8
0
 /// <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>();
        }
Example #10
0
 void Start()
 {
     playerController = GetComponent <Player.PlayerController>();
     currentHealth    = startingHealth;
 }
Example #11
0
 public PlayerData(Player.PlayerController player)
 {
     Player = player;
     elapsedTimeSinceExit = 0f;
     isExitTimeActive     = false;
 }
Example #12
0
 /// <summary>
 /// This method detaches the raft from a PlayerController.
 /// </summary>
 public void Detach()
 {
     pawn  = null;
     pawn2 = null;
 }
Example #13
0
 /// <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;
 }
Example #14
0
 //c-tor
 public ConditionController(PlayerController playerController)
 {
     m_playerController = playerController;
     m_ConditionsList = new List<Condition>();
 }
Example #15
0
 /// <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);
Example #16
0
        /// <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;
                }

            }
        }
Example #17
0
 // Use this for initialization
 void Start()
 {
     m_OrientationKeyframesList = new KeyframeList<double>();
     m_PlayerController = GetComponent<PlayerController>();
 }
Example #18
0
 // Use this for initialization
 void Start()
 {
     m_OrientationKeyframesList = new KeyframeList <double>();
     m_PlayerController         = GetComponent <PlayerController>();
 }
Example #19
0
        /**
         * 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;
 }
Example #22
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);
 }