Пример #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");
 }