Inheritance: MonoBehaviour
Esempio n. 1
0
    void Awake()
    {
        //set standard position to the transforms current position
        initalPos = transform.position;

        //find the PlayerInteraction script and add the floorswitch function to the floor delicate
        playerInterAction = GameObject.FindGameObjectWithTag(Tags.PlayerObject).GetComponent<PlayerInteraction>();
        playerInterAction.Floor += FloorSwitch;
    }
Esempio n. 2
0
    void Awake()
    {
        //set the inital position on the door to the door's current position
        initalPos = transform.position;

        //Find the players playerinteraction
        playerInterAction = GameObject.FindGameObjectWithTag(Tags.PlayerObject).GetComponent<PlayerInteraction>();

        //Add the doorstart to the playerInterAction door delicate
        playerInterAction.Door += DoorStart;
    }
    private void Start()
    {
        // get the transform of the main camera
            if (Camera.main != null)
            {
                m_Cam = Camera.main.transform;
            }
            else
            {
                Debug.LogWarning(
                    "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.");
                // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them!
            }

            // get the third person character ( this should never be null due to require component )
            m_Character = GetComponent<ThirdPersonCharacter>();
            m_Interaction = GetComponent<PlayerInteraction>();
    }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     pi = GetComponent<PlayerInteraction>();
 }
Esempio n. 5
0
 void Awake()
 {
     anim = GetComponent <Animator> ();
     playerAudio = GetComponent <AudioSource> ();
     playerMovement = GetComponent <ThirdPersonCharacter> ();
     //playerShooting = GetComponentInChildren <PlayerShooting> ();
     currentHealth = startingHealth;
     HealthSliderStatus(currentHealth);
     //healthSlider.value = currentHealth;
     playerInterction = GetComponent <PlayerInteraction> ();
 }
Esempio n. 6
0
 void Start()
 {
     //gets the playerInteraction script and adds the trapdoor function to the delecate
     playerInteraction = GameObject.FindGameObjectWithTag(Tags.PlayerObject).GetComponent<PlayerInteraction>();
     playerInteraction.TrapDoor += TrapDoor;
 }
Esempio n. 7
0
 public void SetPlayerTransform(Transform playerXform)
 {
     playerTransform = playerXform;
     interactionScript = playerTransform.GetComponent<PlayerInteraction>();
     tpController = (playerTransform.GetComponent("CustomThirdPersonController") as MonoBehaviour);
     GetComponent<CameraPhysics>().SetCameraController(playerTransform.GetComponent("CustomThirdPersonCamera") as MonoBehaviour);
 }
 // Use this for initialization
 // ReSharper disable once UnusedMember.Local
 void Start()
 {
     _player = GameObject.FindGameObjectWithTag("Player");
     _playerMovementScript = _player.GetComponent<PlayerInteraction>();
 }
 void Start()
 {
     m_Animator = GetComponent<Animator>();
         m_Rigidbody = GetComponent<Rigidbody>();
         m_Interaction = GetComponent<PlayerInteraction>();
         m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
 }
Esempio n. 10
0
    void Awake()
    {
        instance = this;
        ResetEvents();

        anim = GetComponent<Animator>();
        audio = GetComponent<PlayerAudio>();
        damageFlash = GetComponent<SpriteFlash>();
        feedback = GetComponent<PlayerForceFeedback>();
        health = GetComponent<PlayerHealth>();
        input = GetComponent<PlayerInput>();
        interaction = GetComponent<PlayerInteraction>();
        physics = GetComponent<PlayerPhysics>();
        weapon = GetComponent<PlayerWeapon>();

        meleeAttackBox = transform.FindChild("MeleeAttackBox").gameObject;
    }
Esempio n. 11
0
 void Start()
 {
     //getting the players script and adding the nextlevel function
     playerInterAction = GameObject.FindGameObjectWithTag(Tags.PlayerObject).GetComponent<PlayerInteraction>();
     playerInterAction.NextLevel += NextLevel;
 }