Forum rules - please read before posting.

Trouble Importing Package Into Current Project

Hello, I'm currently working on a project where I'm unable to import the Adventure Creator package properly. 

Below is the error I'm seeing:

Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs(1761,37): error CS1061: Type `EventSystem' does not contain a definition for `SetSelectedGameObject' and no extension method `SetSelectedGameObject' of type `EventSystem' could be found (are you missing a using directive or an assembly reference?)

I can get the package to import properly in a new project using Unity 5.0.1p1 but not using my current project. 

Any info would be greatly appreciated.

Thanks!

Comments

  • There could be a conflict with a script or class name from one of your other assets, most likely one named "EventSystem".  I'm looking to fix such errors for the next release, but in this case the EventSystem that AC refers to is actually a Unity base class, so it could be that the conflicting script has no namespace of it's own - though I can only guess at this point.

    Is there any such script in your current project, and can it be easily modified?
  • edited May 2015
    Hi Chris,

    Thanks for the response.

    Yes there is such a script in our project but unfortunately things can't be easily modified at this point, mainly because our project is a fully released product. Changing the event system would be a ton of work since it has tendrils across the game.

    We're/were evaluating Adventure Creator, which is cool, thank you, and are happy to test your potential fixes for compatibility since you guys want maximum compatibility with existing projects.
  • OK, try this: open up PlayerMenus.cs and do a mass search-and-replace of any instances of:

    EventSystem

    to:

    UnityEngine.EventSystems.EventSystem

    so that e.g. line 48 reads:

    private UnityEngine.EventSystems.EventSystem eventSystem;

    That should remove the conflict, but without your own script to hand I can only guess.  Let me know if that fixes the issue, and I'll work that into the next release.
  • I I just tried it and only found 4 instances where it would be replaced. Is that correct?

    I received the following errors:

    Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs(109,95): error CS0030: Cannot convert type `EventSystem' to `UnityEngine.EventSystems.EventSystem'

    Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs(116,41): error CS0029: Cannot implicitly convert type `EventSystem' to `UnityEngine.EventSystems.EventSystem'
  • There should be 5 by my count - go through each of them in turn.  Bear in mind this is a case sensitive operation - any reference to e.g. "eventSystem" should be ignored.  There are also function names e.g. CreateEventSystem () that should be ignored too.
  • The ones that I've found are on lines 48, 103, 105, 109, 115, and 116. Replacing those extra two instances fixed one error but not all.

    I still receive the "Cannot convert type" error:

    Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs(109,95): error CS0030: Cannot convert type `EventSystem' to `UnityEngine.EventSystems.EventSystem'
  • Ah. Seems you'll need to do the same thing for MenuManager.cs - lines 28, and 75 (twice).  Sorry, didn't see that.
  • Thanks Chris, I appreciate your help. This seems to be a bigger rabbit hole than I was anticipating haha. 

    I had to change Sprite to UnityEngine.Sprite because of a conflict with our game. Which led to the error below:

    Assets/AdventureCreator/Scripts/Logic/Editor/ContainerEditor.cs(24,25): error CS0029: Cannot implicitly convert type `AC.InventoryManager' to `InventoryManager'

    That line then says that AdvGame doesn't exist. I think we just might have too many conflicts with our existing project.
  • Script conflicts of other kinds are being fixed for the next release.  The fact that the original errors related to EventSystem suggests that it should actually be possible to make AC fully compatible with your existing project.  I can't say when v1.46 will be released, but I'm hopeful that it'll be within the next couple of weeks.

    When it is, please give it a try - as I'm quite confident your problems will then be solved.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.