I'm trying to put an inventory management system (Devion Games from Unity's asset store) into the Ellen 3d Gamekit project (Also from Unity).
The problem I'm facing is releasing the mouse and camera movement when you open one of Devion's inventory or crafting menus). I can see where Devion pauses playerinput if using their 3rd person camera. Devion...UIWidget.cs:
if (m_CameraController != null)
{
this.m_CameraTransform.SendMessage("Activate", this.m_CameraPreset, SendMessageOptions.DontRequireReceiver);
}else {
//Show Cursor without ThridPersonCamera
this.m_PreviousLockMode = Cursor.lockState;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
// MY CODE trying to use Gamekit3D's PlayerInput's GainControl()
//m_Player.GetComponent("PlayerInput");
}
But of course the Ellen 3d Gamekit uses a Cinemachine.
I thought it would be as easy as adding a "using GameKit3D" to the above code, then referencing it exactly how the pause menu from GameKit3D does
GameKit3D...StartUI:
PlayerInput.Instance.GainControl();
However, in the all the Devion files, when I try to do "using Gamekit3D" I get "type or namespace not found".
I can put "using DevionGames" in the Gamekit3D scripts, but not the other way around.
As you can probably tell, I'm new to all this. Things I've tried:
- Relocating all the Devion scripts out of the folder structure and into assets/scripts. This broke all kinds of references. But I was able to add "using Gamekit3D", but there were so many problems I couldn't get the game to load.
- I tried renaming the Devion namespace to the Gamekit3D and that also created too many errors for me to figure out.
- I've messed around a little with assembly definitions and references but honestly, it's way over my head and everything I tried immediately broke references to other things.
- I tried as many kind of references as I could. When I debugged, I could see the class I wanted to use in the place I wanted to use it, but I could not figure out how to getcomponent or FindGameObjectWithTag
Here's a picture of debuging where loading the Devion menu releases mouse control and you can see the PlayerInput which has public voids "ReleaseControl()" & "GainControl()" that I want to use: debug showing what I want to access where I want to access it
One more thing I've explored and may be playing in here is that most of the scripts related to Devion's menues are not Monobehaviour and the Gamekit3D scripts, PlayerInput most notably, is a Monobehaviour and I've played around with switching those up, or accessing the Gamekit3D gameobject as Monobehaviour.
EDIT to add structure: The reason I think it might be related to an assembly is how I can access one namespace from the other, but not vice versa:
My project structure is as follows:
- Gamekit3D (all the scripts in this folder structure can add "using devion") -- prefabs, scripts and such
- Devion (all the scripts in this folder structure canNOT add "using Gamekit3D") -- prefabs, scripts and such
- Scripts (all the scripts in this folder structure can add both "using devion" & "using Gamekit3D")
here is a look at the solution view: a look at the solution exploreer
I am quite stuck with this and any help is appreciated!