예제 #1
0
    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);
    }
예제 #2
0
    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>());
    }
예제 #3
0
    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>());
    }
예제 #4
0
 public BirdProjectileLauncher(IPlayerAudioManager playerAudioManager)
 {
     AudioManager     = playerAudioManager;
     CatProjectPrefab = Resources.Load <GameObject>("Prefabs/BirdProjectile");
 }