static public IAttackLauncher Create(AttackKind kind, IPlayerAudioManager playerAudioManager, Player player) { switch (kind) { case AttackKind.BirdPoop: return(new BirdProjectileLauncher(playerAudioManager)); case AttackKind.CatProjectile: default: return(new CatProjectileLauncher(playerAudioManager, player)); } return(null); }
public FlyingCritterMover(GameObject critter, FlyingCritterMoverConfig config, IPlayerAudioManager audioManager) { this.critter = critter; this.config = config; this.audioManager = audioManager; hasHadAnyInput = false; currentState = STATE.FLYING; Cursor.lockState = CursorLockMode.Locked; rb = critter.GetComponent <Rigidbody>(); rb.useGravity = false; rb.mass = config.Mass; launcher = AttackLauncherFactory.Create(config.attackKind, audioManager, critter.GetComponentInParent <Player>()); }
public CritterMover(GameObject critter, CritterMoverConfig config, IPlayerAudioManager audioManager) { this.critter = critter; this.config = config; rb = critter.GetComponent <Rigidbody>(); radius = critter.GetComponent <SphereCollider>().radius; Head = critter.transform.Find("Head").gameObject; NeckBone = FindChildByName("neck", critter.transform).gameObject; childCamera = critter.GetComponentInChildren <Camera>().gameObject; cameraBobT = 0; suspensionRadius = config.suspensionRadiusRatio * radius; this.audioManager = audioManager; launcher = AttackLauncherFactory.Create(config.attackKind, audioManager, critter.GetComponentInParent <Player>()); }
public BirdProjectileLauncher(IPlayerAudioManager playerAudioManager) { AudioManager = playerAudioManager; CatProjectPrefab = Resources.Load <GameObject>("Prefabs/BirdProjectile"); }