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