1

I have a problem that is related to the Dot Syntax.

I have this condition (I am only pasting the relevant code parts):

using UnityEngine;
using Assets.Code.Interfaces;
using Assets.Code.Scripts;
using System.Collections;  // dicionario
using System.Collections.Generic;  // dicionario

namespace Assets.Code.States

if (LoadDiagram.diagramaCarga.TryGetValue(gametime, out test)) // Returns true.
            {
                GUI.Box (new Rect (Screen.width - 650, 275, 50, 25),  test.ToString ());
            }

And then I have the script where this LoadDiagram is stored:

using UnityEngine;
using Assets.Code.Interfaces;
using System.Collections;  // dicionario
using System.Collections.Generic;  // dicionario
using System;
namespace AssemblyCSharp
{
    public class LoadDiagram
    {
        public LoadDiagram ()
        {
            Dictionary<int, float> diagramaCarga = new Dictionary<int, float>();

            diagramaCarga.Add(0, 4.2F);
            diagramaCarga.Add(1, 4F);
            diagramaCarga.Add(2, 3.6F);
            diagramaCarga.Add(3, 3.4F);
        }
    }
}

This connection between scripts is not working, I get this error:

error CS0234: The type or namespace name Scripts' does not exist in the namespaceAssets.Code'. Are you missing an assembly reference?

In the folder Code, there is a folder named scripts where this LoadDiagram is stored, so I don't know how to fix this. Any help is deeply appreciated.

1
  • You may get more relevant answers if you posted the actual code; the snippets in their current state are invalid, re: if (LoadDiagram.diagramaCarga.TryGetValue(gametime, out test)) should be in a class within a method. Commented Dec 9, 2015 at 1:21

2 Answers 2

1

Although your file LoadDiagram is in a folder Scripts, it is not in the namespace "Scripts". To do that, replace the namespace "AssemblyCSharp" with "Assets.Code.Scripts", or just remove that using statement.

Sign up to request clarification or add additional context in comments.

1 Comment

I had tried that before with no success but it works now, I think that the changes we're not updated
1

LoadDiagram appears to be in the AssemblyCSharp namespace from the 2nd code snippet. Change the namespace from AssemblyCSharp to Assets.Code.Scripts and that should resolve the error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.