Ejemplo n.º 1
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>());
    }
Ejemplo n.º 2
0
 static public void DrawGizmos(Vector3 critterPosition, float critterRadius, CritterMoverConfig config)
 {
     Gizmos.color = Color.green;
     Gizmos.DrawWireSphere(critterPosition + Vector3.down * config.extraHeight, critterRadius * config.suspensionRadiusRatio);
 }