コード例 #1
0
    private void Start()
    {
        crouching = false;
        walking   = false;
        running   = false;

        speed     = normalSpeed;
        jumpSpeed = normalJumpSpeed;

        mainCamera        = GameObject.FindGameObjectWithTag(Tags.mainCamera).transform;
        standardCamHeight = mainCamera.localPosition.y;
        crouchCamHeight   = standardCamHeight - crouchDeltaHeight;

        audioSource = this.GetComponent <AudioSource>();

        controller = this.GetComponent <CharacterController>();
        parameter  = this.GetComponent <Tps_PlayerParameter>();

        normalContollerCenter  = controller.center;
        normalControllerHeight = controller.height;
    }
コード例 #2
0
    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;
    }
コード例 #3
0
 private void Start()
 {
     LockCusor = true;
     parameter = this.GetComponent <Tps_PlayerParameter>();
     input     = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <Tps_Input>();
 }
コード例 #4
0
 private void Start()
 {
     parameter   = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <Tps_PlayerParameter>();
     m_Transform = transform;
     m_Transform.localPosition = positionOffset;
 }