void Start() { initialPosition = transform.localPosition; //position based on the parent not the world initialRotation = transform.localRotation.eulerAngles; weaponAnimations = GetComponent <WeaponAnimations>(); weaponAudio = GetComponent <WeaponAudio>(); weaponManager = GetComponent <WeaponManager>(); weaponADS = GetComponent <WeaponAimDownSights>(); }
public string GetSoundEffect(WeaponAnimations anim) { int index = (int)anim; if (SoundEffects[index].Count == 0) return string.Empty; if (SoundEffects[index].Count == 1) return SoundEffects[index][0]; int randIndex = RandomHelper.RandomGen.Next(0, SoundEffects[index].Count); return SoundEffects[index][randIndex]; }
private void SetupSprites() { WeaponAnimation = WeaponAnimations.Animation(AnimationStatus.Still_Right); WeaponSprite = new SpriteNode(WeaponAnimation); WeaponSprite.Layer = 1; AddChild(WeaponSprite); HelmAnimation = HelmAnimations.Animation(AnimationStatus.Still_Right); HelmSprite = new SpriteNode(HelmAnimation); HelmSprite.Position = new Location(0, -4); HelmSprite.Layer = -1; AddChild(HelmSprite); }
void Start() { initialPosition = transform.localPosition; //position in respect to the parent (player) weaponAnimations = GetComponent <WeaponAnimations>(); }
public static void SetWeaponAnimation(this Player player, WeaponAnimations animation) { player.WeaponAnimation = (int)animation; }