Ejemplo n.º 1
0
    public new void Start()
    {
        anim         = gameObject.GetComponentInChildren <Animator>();
        agent        = gameObject.GetComponent <NavMeshAgent>();
        player       = GameObject.FindWithTag("Player").transform;
        playerScript = player.GetComponent <NewPlayerMovement>();
        agent.autoTraverseOffMeshLink = true;
        eyes   = Find(transform, "Eyes");
        muzzle = Find(transform, "Muzzle");
        shot   = GetComponent <LineRenderer>();
        coll   = GetComponent <Collider>();

        preferedDistance = Random.Range(shootDistance / 2, shootDistance);
        lastSeen         = null;
        agent.SetDestination(transform.position);

        if (eyes == null)
        {
            throw new System.Exception(gameObject.ToString() + " says: Eyes not found, how am I supposed to see ?!?");
        }

        if (muzzle == null)
        {
            throw new System.Exception(gameObject.ToString() + " says: Muzzle not found, how am I supposed to exterminate ?!?");
        }
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        WeaponH = gameObject.transform.GetChild(0).gameObject;
        spriteR = gameObject.GetComponent <SpriteRenderer>();

        timeStartHit = -20.0f;
        moveScript   = gameObject.GetComponent <NewPlayerMovement>();
        meleeScript  = gameObject.GetComponent <playermelee>();
        rb           = gameObject.GetComponent <Rigidbody2D>();
        isBackBullet = false;

        int default_ = PlayerPrefs.GetInt("use_default");

        if (default_ != 1)
        {
            health = PlayerPrefs.GetInt("hp");
        }
        else
        {
            health = maxHealth;
        }
        //vida maxima na Barra de Vida
        healthBar.SetMaxHealth(maxHealth);
        healthBar.SetHealth(health);
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     rBody              = GetComponent <Rigidbody>();
     audioSource        = GetComponent <AudioSource>();
     playerMovement     = GetComponent <NewPlayerMovement>();
     audioSource.pitch  = minPitch;
     audioSource.volume = minVolume;
 }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        guide  = GameObject.FindGameObjectWithTag("LookAtMe");

        playerScriptrb = player.GetComponent <NewPlayerMovement>();

        Offset = new Vector3(-10, 5, 0);
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     TouristNumber = 0;
     TouristDialogue.SetActive(false);
     Player       = GameObject.FindGameObjectWithTag("Player");
     PlayerScript = Player.GetComponent <NewPlayerMovement>();
     Talk.SetActive(false);
     talking = false;
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        Player         = GameObject.FindGameObjectWithTag("Player");
        Guide          = GameObject.FindGameObjectWithTag("LookAtMe");
        PlayerScript   = Player.GetComponent <PlayerMovement>();
        PlayerScriptrb = Player.GetComponent <NewPlayerMovement>();

        Offset   = new Vector3(-5, 0, 0);
        Inverted = true;
    }
Ejemplo n.º 7
0
    public GameData(NewPlayerMovement playerPosition, PlayerHealth healthplayer, ScoreSystem scoregame)
    {
        playerhealth = healthplayer.CurrentHealth;
        score        = scoregame.playerScore;

        position    = new float[3];
        position[0] = playerPosition.transform.position.x;
        position[1] = playerPosition.transform.position.y;
        position[2] = playerPosition.transform.position.z;
    }
Ejemplo n.º 8
0
    void Start()
    {
        movement     = GetComponent <NewPlayerMovement>();
        depth        = Vector3.Distance(camLock.position, transform.position);
        grenadeCount = maxGrenades;

        bulletTimer   = bulletFireSpacingTime;
        grenadeTimer  = grenadeFireSpacingTime;
        weaponManager = WeaponManager.instance;
    }
Ejemplo n.º 9
0
 // Start is called before the first frame update.
 private void Start()
 {
     text                 = null;
     shownText.text       = "";
     panel                = shownText.transform.parent.gameObject;
     objectToDisable      = null;
     activeParagraph      = 0;
     lettersRead          = 0;
     paragraphEnd         = false;
     movementRef          = this.GetComponent <NewPlayerMovement> ();
     normalMod.enabled    = true;
     invisibleMod.enabled = false;
     sceneName            = SceneManager.GetActiveScene().name;
     fadeAnimator         = canvas.GetComponentInChildren <Animator> ();
 }
Ejemplo n.º 10
0
 private void Awake()
 {
     playerMovement = GetComponent <NewPlayerMovement>();
 }
Ejemplo n.º 11
0
 void Start()
 {
     otherScript = player.GetComponent <NewPlayerMovement>();
 }
Ejemplo n.º 12
0
    // Start is called before the first frame update

    void Start()
    {
        StartCoroutine(WaitBeforeSettingProjectileActive());
        player = PlayerReference.player.GetComponent <NewPlayerMovement>();
        warning.SetActive(true);
    }
Ejemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     targetPos = transform.position;
     player    = FindObjectOfType <NewPlayerMovement>();
 }
 // Start is called before the first frame update
 void Start()
 {
     player         = PlayerReference.player;
     playerMovement = player.GetComponent <NewPlayerMovement>();
 }
Ejemplo n.º 15
0
 // Start is called before the first frame update
 void Start()
 {
     player           = PlayerReference.player.GetComponent <NewPlayerMovement>();
     originalPosition = transform.position;
 }
Ejemplo n.º 16
0
 // Use this for initialization
 void Start()
 {
     Player       = GameObject.FindGameObjectWithTag("Player");
     PlayerScript = Player.GetComponent <NewPlayerMovement>();
 }
Ejemplo n.º 17
0
 private void Start()
 {
     playerMovement         = GetComponent <NewPlayerMovement>();
     playerMovement.enabled = false;
 }
Ejemplo n.º 18
0
 public void Start()
 {
     playerMovement = FindObjectOfType <NewPlayerMovement>();
     colaMentos     = playerMovement.mentosCount;
 }