Exemple #1
0
 private void Start()
 {
     enemySight   = this.GetComponent <Tps_EnemySight>();
     nav          = this.GetComponent <NavMeshAgent>();
     player       = GameObject.FindGameObjectWithTag(Tags.player).transform;
     playerHealth = player.GetComponent <Tps_PlayerHealth>();
 }
Exemple #2
0
 private void Start()
 {
     nav           = this.GetComponent <NavMeshAgent>();
     col           = GetComponentInChildren <SphereCollider>();
     anim          = this.GetComponent <Animator>();
     player        = GameObject.FindGameObjectWithTag(Tags.player);
     playerHealth  = player.GetComponent <Tps_PlayerHealth>();
     playerControl = player.GetComponent <Tps_PlayerControl>();
     Tps_ActionController.PlayerShootEvent += ListenPlayer;
     hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();
 }
Exemple #3
0
    private void Start()
    {
        anim           = this.GetComponent <Animator>();
        laserShotLine  = this.GetComponentInChildren <LineRenderer>();
        laserShotLight = laserShotLine.gameObject.GetComponent <Light>();

        col          = GetComponentInChildren <SphereCollider>();
        player       = GameObject.FindGameObjectWithTag(Tags.player).transform;
        playerHealth = player.GetComponent <Tps_PlayerHealth>();
        hash         = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <HashIDs>();

        laserShotLine.enabled    = false;
        laserShotLight.intensity = 0;

        scaledDamage = maximumDamage - minimumDamage;
    }
Exemple #4
0
    private void Start()
    {
        actionController = this.GetComponent <Tps_ActionController>();
        playerControl    = this.GetComponent <Tps_PlayerControl>();
        cam            = this.GetComponentInChildren <Tps_TpCamera>();
        playerHealth   = this.GetComponent <Tps_PlayerHealth>();
        networkManager = GameObject.FindGameObjectWithTag(Tags.networkManager).GetComponent <NetworkManager>();

        enemyCreate    = GameObject.FindGameObjectWithTag(Tags.enermy).GetComponent <Tps_EnemyCreate>();
        enemyAI        = GameObject.FindGameObjectWithTag(Tags.enermy).GetComponent <Tps_EnemyAI>();
        enemyAnimation = GameObject.FindGameObjectWithTag(Tags.enermy).GetComponent <Tps_EnemyAnimation>();
        enemyShoot     = GameObject.FindGameObjectWithTag(Tags.enermy).GetComponent <Tps_EnemyShoot>();
        enemySight     = GameObject.FindGameObjectWithTag(Tags.enermy).GetComponent <Tps_EnemySight>();

        WayPoint_01 = GameObject.FindGameObjectWithTag(Tags.wayPoint).GetComponent <Transform>();
    }
    private void Start()
    {
        parameter         = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <Tps_PlayerParameter>();
        playerControl     = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <Tps_PlayerControl>();
        playerHealth      = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <Tps_PlayerHealth>();
        playerInventory   = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <Tps_PlayerInventory>();
        messageController = Tps_MessageController.Instance;
        anim        = this.GetComponent <Animation>();
        enemyHealth = GameObject.FindGameObjectWithTag(Tags.enermy).GetComponent <Tps_EnemyHealth>();

        networkManager = GameObject.FindGameObjectWithTag(Tags.networkManager).GetComponent <NetworkManager>();

        weaponContainer = new List <Tps_Weapon>(GameObject.FindGameObjectWithTag(Tags.weaponContainer).GetComponentsInChildren <Tps_Weapon>());
        weaponContainer[0].gameObject.SetActive(true);
        weaponContainer[1].gameObject.SetActive(false);
        //flash = this.transform.FindChild("muzzle_flash").GetComponent<MeshRenderer>();
        //currentBullet = bulletCount;
        //currentChargerBullet = chargerBulletCount;
        bulletText.text = currentBullet + "/" + currentChargerBullet;
        healthText.text = "血量: " + playerHealth.hp + "";
        weaponText.text = weaponInfo;
        healthTimer     = 0;
    }
 private void Start()
 {
     player          = GameObject.FindGameObjectWithTag(Tags.player);
     playerInventory = player.GetComponent <Tps_PlayerInventory>();
     playerHealth    = player.GetComponent <Tps_PlayerHealth>();
 }