// Start is called before the first frame update
    void Start()
    {
        Canvas    = GameObject.FindGameObjectWithTag("Canvas");
        CButton   = Canvas.transform.Find("CrouchButton").Find("CButton");
        cbpScript = CButton.GetComponent <CrouchButtonPress>();

        DamageUIBlood = Canvas.transform.Find("DamageUIBlood");
        duiBImage     = DamageUIBlood.GetComponent <Image>();
        DamageUIDark  = Canvas.transform.Find("DamageUIDark");
        duiDImage     = DamageUIDark.GetComponent <Image>();

        GameOverUINoise = Canvas.transform.Find("GameOverUINoise");
        gouiNImage      = GameOverUINoise.GetComponent <Image>();
        GameOverUIText  = Canvas.transform.Find("GameOverUIText");
        gouiTImage      = GameOverUIText.GetComponent <Image>();

        gcuiBImage = Canvas.transform.Find("GameClearUIBackground").GetComponent <Image>();

        PistolReadySlider = Canvas.transform.Find("PistolShootButton").Find("PistolReadySlider");
        prsSlider         = PistolReadySlider.GetComponent <Slider>();

        Pistol     = GameObject.FindGameObjectWithTag("Pistol");
        pistolMesh = Pistol.transform.GetComponent <MeshRenderer>();

        bodyPartsMesh = transform.gameObject.GetComponentsInChildren <SkinnedMeshRenderer>();

        playerCollider  = transform.parent.GetComponent <CapsuleCollider>();
        playerRigidbody = transform.parent.GetComponent <Rigidbody>();

        audioSources = transform.GetComponents <AudioSource>();

        gocScript = GameObject.FindGameObjectWithTag("Goal").GetComponent <GoalObjectController>();
    }
    // Start is called before the first frame update
    void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player");
        Enemy  = transform.root.gameObject;

        animator = Enemy.GetComponent <Animator>();

        Canvas = GameObject.FindGameObjectWithTag("Canvas");

        PSButton  = Canvas.transform.Find("PistolShootButton").Find("PSButton");
        lbbScript = PSButton.GetComponent <LiveBulletOnButton>();

        Camera   = GameObject.FindGameObjectWithTag("MainCamera");
        lbScript = Camera.GetComponent <LiveBullet>();

        agent = Enemy.GetComponent <NavMeshAgent>();

        foundPlayer   = false;
        warningPlayer = false;

        SetDestinationRandomly();

        randomCountD1 = Random.Range(2f, 4f);   //Battle時に移動する時間
        randomCountD2 = Random.Range(2f, 5f);   //Battle時にアイドルする時間

        randomCountF1 = Random.Range(2f, 4f);   //発砲時のインターバル
        randomCountF2 = Random.Range(1f, 2.5f); //発砲時間

        audioSources = transform.GetComponents <AudioSource>();

        gocScript = GameObject.FindGameObjectWithTag("Goal").GetComponent <GoalObjectController>();
    }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     gocScript       = GameObject.FindGameObjectWithTag("Goal").GetComponent <GoalObjectController>();
     GOCanvas        = transform.parent.GetChild(1).gameObject;
     disposalSlider  = GOCanvas.transform.GetChild(0).GetComponent <Slider>();
     disposalBackBar = GOCanvas.transform.GetChild(0).GetChild(0).GetComponent <Image>();
     disposalFillBar = GOCanvas.transform.GetChild(0).GetChild(1).GetChild(0).GetComponent <Image>();
     MainCamera      = GameObject.FindGameObjectWithTag("MainCamera");
     audioSources    = transform.GetComponents <AudioSource>();
     gocText         = GameObject.FindGameObjectWithTag("Canvas").transform.GetChild(12).GetComponent <Text>();
 }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player");

        SearchPlayer = transform.GetChild(2).gameObject;
        ecScript     = SearchPlayer.GetComponent <EnemyController>();

        animator = GetComponent <Animator>();

        gocScript = GameObject.FindGameObjectWithTag("Goal").GetComponent <GoalObjectController>();
        phpScript = Player.transform.GetChild(0).GetComponent <PlayerHP>();
    }
    // Start is called before the first frame update
    void Start()
    {
        Player    = GameObject.FindGameObjectWithTag("Player").transform.GetChild(0);
        phpScript = Player.GetComponent <PlayerHP>();

        rigidBody       = transform.GetComponent <Rigidbody>();
        initialPos      = transform.position;
        bulletDirection = transform.forward;
        earlyHitRaycast = Physics.Raycast(transform.position, bulletDirection, out earlyHitInfo, earlyHitRange);

        gocScript = GameObject.FindGameObjectWithTag("Goal").GetComponent <GoalObjectController>();
    }