示例#1
0
 void Start()
 {
     menu    = GetComponent <Canvas> ();
     imedz   = menu.GetComponent <Image> ();
     kolor   = Color.black;
     kolor.a = 0;
     gracz   = GameObject.FindGameObjectWithTag("Player").GetComponent <GraczFPS> ();
 }
示例#2
0
 void Start()
 {
     audio      = GetComponent <AudioSource> ();
     audio.clip = sounds [Random.Range(0, sounds.Length)];
     gracz      = GameObject.Find("Gracz").GetComponent <GraczFPS> ();
     navMesh    = GetComponent <UnityEngine.AI.NavMeshAgent> ();
     model      = transform.FindChild("Cukierek-Model");
 }
示例#3
0
 void Start()
 {
     audio      = GetComponent <AudioSource> ();
     audio.clip = sounds [Random.Range(0, sounds.Length)];
     navMesh    = GetComponent <UnityEngine.AI.NavMeshAgent> ();
     gracz      = GameObject.FindGameObjectWithTag("Player").GetComponent <GraczFPS> ();
     t_barrel   = transform.FindChild("Lufa");
 }
示例#4
0
    bool isSinking;                         // Prawda, jeśli przeciwnik spływa.

    void Start()
    {
        // Ustawianie referencji.
        punkty     = GameObject.FindGameObjectWithTag("GUI");
        player     = GameObject.FindGameObjectWithTag("Player");
        deathPoint = GameObject.Find("Swiatlo").GetComponent <Spawn> ();
        nav        = GetComponent <UnityEngine.AI.NavMeshAgent> ();
        playerS    = player.GetComponent <GraczFPS> ();
        //anim = GetComponent <Animator> ();
        capsuleCollider = GetComponent <CapsuleCollider> ();

        // Ustawianie zdrowia.
        currentHealth = startingHealth;
    }
示例#5
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer != 8)
        {
            return;
        }
        ZdrowiePrzeciwnika enemyHealth = other.GetComponentInParent <ZdrowiePrzeciwnika> ();

        if (enemyHealth != null)
        {
            return;
        }
        GraczFPS gracz = other.GetComponent <GraczFPS> ();

        if (gracz != null)
        {
            gracz.TakeDamage(damage);
            transform.SetParent(other.gameObject.transform);
        }
        GetComponent <Collider>().gameObject.GetComponent <Collider> ().enabled = false;
        koniec = true;
    }
示例#6
0
 void Start()
 {
     navMesh  = GetComponent <UnityEngine.AI.NavMeshAgent> ();
     gracz    = GameObject.FindGameObjectWithTag("Player").GetComponent <GraczFPS> ();
     particle = transform.FindChild("Particle").GetComponent <ParticleSystem> ();
 }
示例#7
0
 void Start()
 {
     navMesh = GetComponent <UnityEngine.AI.NavMeshAgent> ();
     gracz   = GameObject.FindGameObjectWithTag("Player").GetComponent <GraczFPS> ();
 }
示例#8
0
 void Start()
 {
     gracz   = GameObject.Find("Gracz").GetComponent <GraczFPS> ();
     navMesh = GetComponent <UnityEngine.AI.NavMeshAgent> ();
     anim    = GetComponent <Animator> ();
 }