private float isCanFireTimer = 0; //判断是否可以开枪的计时器 private void Awake() { _instance = this; animatorIKScript = playerMovement2.gameObject.GetComponentInChildren <AnimatorIK>(); bulletText = GameObject.Find("Canvas/PlayerStatusUI/BulletNumber/Text").GetComponent <Text>(); poolManager = new PoolManager(); knapSackUIGo = GameObject.Find("KnapsackUI"); availableGuns = new Dictionary <string, Gun>(); }
// Start is called before the first frame update void Start() { aIK = GetComponent <AnimatorIK>(); anim = GetComponent <Animator>(); CurrentWeapon = WeaponType.PRIMARY; ItemInventory = new Dictionary <string, List <Item> >(); keys = new List <Key>(); swappingWeapons = false; if (PrimaryWeapon) { PrimaryWeaponScript = PrimaryWeapon.GetComponent <Weapon>(); } if (SecondaryWeapon) { SecondaryWeaponScript = SecondaryWeapon.GetComponent <Weapon>(); } }