[Unity] Type or namespace 'Noesis' could not be found
Posted: 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
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. :)
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
Code: Select all
//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
}
}