コード例 #1
0
        private void Start()
        {
            GameObject player             = GameObject.FindWithTag("Player");
            SampleCharacterController scc = player.GetComponent <SampleCharacterController>();

            ammo                 = scc.Weapon.Ammo;
            maxAmmo              = ammo.CurrentValue;
            ammo.OnValueChanged += OnValueChanged;
            hudText.text         = string.Format("{0} / {1}", ammo.CurrentValue, maxAmmo);
        }
コード例 #2
0
        private void Start()
        {
            GameObject player             = GameObject.FindWithTag("Player");
            SampleCharacterController scc = player.GetComponent <SampleCharacterController>();

            ammo                 = scc.Weapon.Ammo;
            maxAmmo              = ammo.CurrentValue;
            ammo.onValueChanged += OnValueChanged;
            OnValueChanged(ammo.CurrentValue);
        }