Not able to use namespace in C#

I am trying to develop a game in Unity editor.
I’m not able to use the namespace from one script into another.
Please find the scripts below.

using System;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;
namespace UnityStandardAssets.CrossPlatformInput
{
public static class CrossPlatformInputManager
{
public enum ActiveInputMethod
{
Hardware,
Touch
}
private static VirtualInput activeInput;
private static VirtualInput s_TouchInput;
private static VirtualInput s_HardwareInput;

AxisTouchButton.cs

using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityStandardAssets.CrossPlatformInput;
namespace UnityStandardAssets.CrossPlatformInput
{
public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
// designed to work in a pair with another axis touch button
// (typically with one having -1 and one having 1 axisValues)
public string axisName = “Horizontal”; // The name of the axis
public float axisValue = 1; // The axis that the value has
public float responseSpeed = 3; // The speed at which the axis touch button responds
public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre
AxisTouchButton m_PairedWith; // Which button this one is paired with
CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input
void OnEnable()
{
if (!CrossPlatformInputManager.AxisExists(axisName))
{
// if the axis doesnt exist create a new one in cross platform input
m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName);
CrossPlatformInputManager.RegisterVirtualAxis(m_Axis);
}
else
{
m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName);
}
FindPairedButton();
}

The script CrossPlatformInputManager has namespace UnityStandardAssets.CrossPlatformInput, but I’m not able to get that namespace in AxisTouchButton.cs in Unity Monodevelop editor.

P.S. : Both the files are located in different directory.

Can anybody please tell me what’s wrong with the namespace?

Thanks,
Rohit

Use code tags please

1 Like

I dont think namespace tied to the directory, probably something else what’s the error log?

If Unity does not throw a compiler error then its an issue in MonoDevelop.

If Unity does throw an error, post both scripts with code tags as well as the error that Unity produces in the console.

This is my error message.

PFB link for my full project.
https://drive.google.com/open?id=0B9ekxav_JxVsRXc2WVRxcU9wbVk

Can anybody please see my project and tell me what’s wrong?
I am trying to build this for Android.

I’ve used the code tags, the code is not displaying here properly.
Still the same issue. Please help

This sounds very similar to a problem I helped someone with a while back, here. The essence being that some stuff seems to use the namespace Unity__StandardAssets, while other stuff uses the namespace UnitySample__Assets. Really easy to overlook.

I’ve never used the standard/sample assets myself, so this is just a shot in the dark, but might be worth trying out.

Checked for that as well… But nothing is working :frowning:

Actually game is working fine for PC standalone build.
But whenever I am changing build to Android and downloading CrossPlatformInput Package, These errors are populating.