advancedfx / afx-unity-interop

(Test) Sample for Unity for HLAE afx_interop (augmented CS:GO). Please note the license does not apply to sub-modules.
MIT License
6 stars 1 forks source link

Test version

Important

Make sure your Unity console does not have the "Error Pause" button pushed in, otherwise the game and Unity will freeze upon exceptions in your other Unity code.

Please understand that this is a test version and things will change heavily!

Installation

We recommend downloading with git, because that way you will get the submodules and have less traffic upon updates.

Don't forget: git submodule update after checking out the latest version.

https://git-scm.com/downloads

cd /c/source/folder/here
git clone --no-checkout https://github.com/advancedfx/afx-unity-interop.git
cd afx-unity-interop
git checkout v0.5.2
git submodule update --init

Usage:

1) Launch CS:GO from HLAE with -afxInterop (case-sensitve option).

2) Load a GOTV demo (the example propject has colorfoul boxes at the T spawn on de_mirage).

3) Enter these commands (if you want the observer target cone):

mirv_calcs handle add localPlayer afxLocalPlayer
mirv_calcs handle add observerTarget afxObserverTarget afxLocalPlayer
mirv_calcs vecAng add handleEye afxObserverEye afxObserverTarget
mirv_calcs bool add alive afxObserverAlive afxObserverTarget
mirv_calcs int add teamNumber afxObserverTeamNumber afxObserverTarget

Hint: There's a spectator handle key calc, so you could make a view cone for every player ;)

4) Unity (Editor): Load the project, open the Example scene in Assets/Resources/Example/Scenes and Run it (Play button).

5) Enter afx_interop connect 1 into console to connect CS:GO to Unity, then it should be drawing the boxes at T-spawn on mirage.

Known problems:

Planned changes:

Support different rendering order with different passes support, so translucency will be handled better.