atoi2008
Topic Author
Posts: 6
Joined: 07 Nov 2018, 21:22

[Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 22:11

Pardon my ignorance
I created a C# file from within Blend to be my Player.cs model class, and the namespace Noesis can not be found. Is this the case just because I need to create the C# file from within Unity and use Visual Studio to edit it and not Blend, or did I miss something?

[The reason why I was using Noesis in a Model class is to use the ImageSource type so I can store a player Avatar
//Player.cs
namespace Pax
{
    using System.ComponentModel;
    using System.Runtime.CompilerServices;
    using Noesis;

    /// <summary>
    /// This is the main Player class
    /// </summary>
    public class Player : INotifyPropertyChanged
    {

        /// <summary>
        /// Initializes a new instance of the Player class
        /// </summary>

        public Player(bool playerIsHuman, string playerName, ImageSource playerAvatar, int playerXP, int playerGold, int playerAlloy, int playerAntimatter, int playerBlueDiamond)
        {
            IsHuman = playerIsHuman;
            Name = playerName;
            Avatar = playerAvatar;
            XP = playerXP;
            Gold = playerGold;
            Alloy = playerAlloy;
            Antimatter = playerAntimatter;
            BlueDiamond = playerBlueDiamond;
        }

        private bool _isHuman;
        /// <summary>
        /// Is True if player is Human or False if player is AI
        /// </summary>
        public bool IsHuman
        {
            get { return _isHuman; }
            set { _isHuman = value; }
        }

        private string _name;
        /// <summary>
        /// Gets or Sets the Player's Name
        /// </summary>
        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                OnPropertyChanged();
            }
        }

        private ImageSource _avatar;
        /// <summary>
        /// Gets or Sets the Player's Avatar
        /// </summary>
        public ImageSource Avatar
        {
            get { return _avatar; }
            set
            {
                _avatar = value;
                OnPropertyChanged();
            }
        }

        private int _xp;
        /// <summary>
        /// Gets or Sets the Player's Experience points
        /// </summary>
        public int XP
        {
            get { return _xp; }
            set
            {
                _xp = value;
                OnPropertyChanged();
            }
        }

        // Resources
        private int _gold;
        /// <summary>
        /// Gets or Sets the Player's Gold amount
        /// </summary>
        public int Gold
        {
            get { return _gold; }
            set
            {
                _gold = value;
                OnPropertyChanged();
            }
        }

        private int _alloy;
        /// <summary>
        /// Gets or Sets the Player's Alloy amount
        /// </summary>
        public int Alloy
        {
            get { return _alloy; }
            set
            {
                _alloy = value;
                OnPropertyChanged();
            }
        }

        private int _antimatter;
        /// <summary>
        /// Gets or Sets the Player's Antimatter amount
        /// </summary>
        public int Antimatter
        {
            get { return _antimatter; }
            set
            {
                _antimatter = value;
                OnPropertyChanged();
            }
        }


        // Premium Resources
        private int _blueDiamond;
        /// <summary>
        /// Gets or Sets the Player's Blue Diamond amount
        /// </summary>
        public int BlueDiamond
        {
            get { return _blueDiamond; }
            set { _blueDiamond = value; }
        }


        #region INotifyPropertyChanged Members
        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
        #endregion

    }
}

After writing this code I realized that it breaks a whole host of things, such as the ObservableCollection<T> that was provided as I'm not writing a pure WPF application. I do wish there was some better tutorials, or some "Real World" type help out there for a neophyte. :)
Last edited by atoi2008 on 13 Nov 2018, 23:04, edited 1 time in total.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: [Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 22:52

Make sure to follow our sample projects, for example the Hello World one. Check that the .cs file is located inside the /Assets unity folder and make sure to use preprocessor directives to only use the Noesis namespace in Unity.
#if UNITY_5_3_OR_NEWER
#define NOESIS
using Noesis;
#else
using System;
using System.Windows;
using System.Windows.Controls;
#endif
 
atoi2008
Topic Author
Posts: 6
Joined: 07 Nov 2018, 21:22

Re: [Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 23:11

Gracias JSantos. I assumed that might be the case. I am sure the questions are all answered there in the sample projects, it will just take a moment or few to hack around and figure it out. I'm self taught and I don't work for a company, completely independent and working on trying to piece together my first big project aside from the simple ones one will never be able to ship. I very much appreciate the time and effort that you and your team have put in to developing this great tool for us.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: [Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 23:17

Thanks to you for using NoesisGUI! Please let us know if you solve the issue.
 
atoi2008
Topic Author
Posts: 6
Joined: 07 Nov 2018, 21:22

Re: [Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 23:38

I haven't figured anything out just yet, but I'm sure my issues are due to just not being as experienced as most of the guys here.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: [Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 23:42

Make sure to also read the First Contact with Blend guide.
 
atoi2008
Topic Author
Posts: 6
Joined: 07 Nov 2018, 21:22

Re: [Unity] Type or namespace 'Noesis' could not be found

13 Nov 2018, 23:57

Make sure to also read the First Contact with Blend guide.
I have actually read that several times now, and while useful, it really only shows us how to import and run the Tutorial projects. If I try to do that with North for example it's completely broken, and that's ultimately the kind of interaction I'm looking for, and Action Bar, which is also not included.

I'm not a stupid person (arguably lol) and I am sure that I can figure it out in the long run and I will eat crow for criticizing, but I do wish things were presented a little more clearly. I feel like I'm left hanging overall.

Also I had used the Old workflow example from the YouTube videos presented back in 2014? to create the blend project first, create an Assets folder, and then Open a unity project inside that and let Unity do the importing, and then importing the Noesis unity asset pack. That approach seemed a little less confusing because I'm not sure what you had meant by putting the CSPROJ file beside the Asset folder meant, and that does the trick. I'm getting off topic here. I believe the original question was answered above with using the #if directive. I am sure I'm not the only one that has been frustrated however.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: [Unity] Type or namespace 'Noesis' could not be found

14 Nov 2018, 00:10

I am sure your are smart person and we know our documentation is far from perfect. Good thing is, it is improving with each version. North example should be straightforward to test and play with, that's the idea with all our introductory samples. I wonder if you would have time to enumerate all the issues you are finding with that sample so we can fix them. Thanks!
 
atoi2008
Topic Author
Posts: 6
Joined: 07 Nov 2018, 21:22

Re: [Unity] Type or namespace 'Noesis' could not be found

14 Nov 2018, 00:19

I am sure your are smart person and we know our documentation is far from perfect. Good thing is, it is improving with each version. North example should be straightforward to test and play with, that's the idea with all our introductory samples. I wonder if you would have time to enumerate all the issues you are finding with that sample so we can fix them. Thanks!
I will address them as they come up. The main problem with a lot of the examples when I cloned the git repo and open them in unity is that I would have compilation errors, I assume that is why those samples were not included in the unity package. I also went with the assumption that I needed to go deep in to the source tree to run the .unity files which didn't work for me even after importing the package.

But yes, my suggestion would be to go back to what you did just to create the button and bouncy ball YouTube tutorial with the original getting started guide and extend that because we all need a little hand holding at first :) And then how to do databinding, and MVVM.
I don't fault your documentation as I so much do my lack of experience. AAA developers who have been working with C++ and writing their own engines for ages can probably just look at the code and go, oh yea, ok I get it :)
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: [Unity] Type or namespace 'Noesis' could not be found

14 Nov 2018, 00:23

I will address them as they come up. The main problem with a lot of the examples when I cloned the git repo and open them in unity is that I would have compilation errors, I assume that is why those samples were not included in the unity package. I also went with the assumption that I needed to go deep in to the source tree to run the .unity files which didn't work for me even after importing the package.
One of the things we want to do is also including the .unitypackages in GitHub, just to avoid the problems you are having. Thanks for your feedback!

Who is online

Users browsing this forum: Google [Bot], vinick and 65 guests