/// <summary> /// Called once before other scripts in the scene /// </summary> void Awake() { // cache the controller's transform for quicker lookup _controllerTransform = controller.transform; // initialize the weapon _currentWeapon = new ROTD_WeaponProperties(); _currentWeapon.weaponType = ROTD_Weapon.WEAPON_TYPE.RollingPin; _currentWeapon.damage = gameManager.weapon.GetWeaponDamage(_currentWeapon.weaponType); // store the start position and rotation for resetting _startPosition = _controllerTransform.position; _startRotation = _controllerTransform.localRotation; // make sure the probability is in the range between zero and one idleAnimationProbability = Mathf.Clamp01(idleAnimationProbability); // register the collider and user delegates boneAnimation.RegisterColliderTriggerDelegate(ColliderTrigger); boneAnimation.RegisterUserTriggerDelegate(UserTrigger); }