Quantcast
Channel: Questions in topic: "namespace"
Viewing all 398 articles
Browse latest View live

[VSCode] namespace error [only on VSCode]

$
0
0
I use vscode to write my code with Unity,but sometimes vscode show this error(The namespace `global::' already contains a definition), I pretty sure there is no other script call the some name The error will be fixed when I change to visual studio but I prefer to use vscode Does anyone know how to fix it. Thanks. Sorry For My Bad English.

Trouble using savepanel and unityeditor namespace in built exe

$
0
0
Hi all, I have read in other questions about this same issue, as far as I understood the moment I use Savepanel I need to use UnityEditor namespace, and this is all fine in the editor, but when I bring this out it just cant build it. I read in several posts related to similar issues that there are 2 solutions to this, one move the scripts to Editor folder/subfolder and the other is include the lines mentioning this inside a " #if UNITY_EDITOR .... #endif" block, however I tried both solutions (full of fears to be honest) and none worked for me, yes I can build the project with either of the solutions propossed but the game is messed and doesnt work when moved to the Editor folder, not even in the editor it works, doing the other way with the check for unity editor it works overal fine inside and outside the editor but the savepanel function doesnt work outside the editor which seems logical as the check for editor gives a false result so its not called, then how can I bring the savepanel to allow the user to save his things? Thanks a lot for any clue regarding this, its a true headache for several hours now. PS Im using version 5.6.1f1 just in case its all different later on and this can be done without checking for editor or doing anything (which I think would be cool)

How do c# scripts get accessed by the Unity Engine

$
0
0
So when I create a script and extend from monobehavior, and for example, put some code in the start() method, how does unity itself, access this custom script i've just made and call that method. There can be hundreds of custom scripts so how does unity execute all these and manage them?

The type or namespace 'blabla' could not be found

$
0
0
Hello everyone ! I was making a camera script (2018.2.0f2). When i made a unity update (2018.3.1f1), the script has now errors like : the type or namespace 'PropretyDrawer' and 'SerializedProprety' could not be found. Here's my script : using UnityEngine; using UnityEditor; using System.Collections.Generic; [CustomPropertyDrawer(typeof(TagSelectorAttribute))] public class TagSelectorPropertyDrawer : PropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (property.propertyType == SerializedPropertyType.String) { EditorGUI.BeginProperty(position, label, property); var attrib = this.attribute as TagSelectorAttribute; if (attrib.UseDefaultTagFieldDrawer) { property.stringValue = EditorGUI.TagField(position, label, property.stringValue); } else { //generate the taglist + custom tags List tagList = new List(); tagList.Add(""); tagList.AddRange(UnityEditorInternal.InternalEditorUtility.tags); string propertyString = property.stringValue; int index = -1; if(propertyString =="") { //The tag is empty index = 0; //first index is the special entry } else { //check if there is an entry that matches the entry and get the index //we skip index 0 as that is a special custom case for (int i = 1; i < tagList.Count; i++) { if (tagList[i] == propertyString) { index = i; break; } } } //Draw the popup box with the current selected index index = EditorGUI.Popup(position, label.text, index, tagList.ToArray()); //Adjust the actual string value of the property based on the selection if(index==0) { property.stringValue = ""; } else if (index >= 1) { property.stringValue = tagList[index]; } else { property.stringValue = ""; } } EditorGUI.EndProperty(); } else { EditorGUI.PropertyField(position, property, label); } } } Can someone help me ? Thanks :)

error: namespace already contains definition

$
0
0
I have 2 Scenes in a project in which both of them uses a part of standard assets. Standard assets\Editor\water\water4\waterbaseeditor.cs. The type or namespace name'WaterBase' could not be found (are u missing a directive or assembly refrence). Have 4 similar errors from the water4 folder. My scene 1 has similar name scripts but have different code. the error message comes from the scene 2 project files which contain the standard assets. I dont think its the issue of duplicate scripts because script name are same but code are different for these 4 scripts.what do i do this i have screenshot of console https://prntscr.com/m6nuju

Trying to Create Custom Encryption

$
0
0
Hello, I am trying to create an encryption for my game. I have the thing all laid out, but I have not been able to get it to work. The file is a bit big so I linked the [file][1]. I made sure I added the namespace to my code. I then typed
MyEncryptionConverter converter = new MyEncryptionConverter();
Once I had that, I tried to access the function to write to the file using:
converter.WriteFile(fileLines, filePath);
I feel like it should be working, but when I open the file, none of my code has been encrypted! Help is greatly appreciated! [1]: /storage/temp/131262-myencrypting.txt

public Inventory not recognized

$
0
0
When I type in public Inventory inventory; it says that the type or namespace could not be found. I found this in a BlackThornProd tutorial, is this outdated?

Restore a backed up project - Prefab Connections

$
0
0
(For TLDR please jump to last section where my questions are.)

I tried to restore one of my backed up projects (just in case of a hazard scenario.)

I was backing up (copying the folder) Assets, ProjectSettings, UnityPackageManager just these three folders. I also have some rare full folder backups but I thought these 3 folders are enough. (Also I recall that I was able to restore just using these 3 folders.)

But today when i restore, first I got "Namespace not found" error. One or two classes were unreachable at visual studio. Somehow I could get rid of it.(Still don't know how. Deleted the VS project files. After the deletion the errors were still present. But now they're gone.)

But the Prefab connections were also gone (from the start). So my questions are:

1. Is there any way to restore the prefab connections in this scenario(Restoring a project with only Assets, ProjectSettings, UnityPackageManager folders) or should I connect them manually again?

2. Apart from Prefab Connections, everything should be fine? (I will also test it now, but believe in your guys' experience and knowledge more than my quick test as I can miss something. There are a lot of attributes and settings in a project as you already know)

3. In which file does prefab connections are kept?

4. What is the proper way of backing up a Unity project in case of a recovery situation? Is copying the whole folder enough? Was copying these 3 folders a mistake? (Assets, ProjectSettings, UnityPackageManager)

I have problem with the type name or namespace name 'bl_SettingPropiertis' could not be found. Please help me with this.

$
0
0
Hello, I have problem with the script bl_BombDefuse. I have this error: Assets/Addons/BombDefuse/Content/Scripts/bl_BombDefuse.cs(34,13): error CS0246: The type or namespace name `bl_SettingPropiertis' could not be found. Are you missing an assembly reference?. Please help me with this. Here is the script: using UnityEngine; using System.Collections; using Hashtable = ExitGames.Client.Photon.Hashtable; [RequireComponent(typeof(PhotonView))] public class bl_BombDefuse : bl_PhotonHelper { [HideInInspector]public int ID; [Header("Settings")] public Team BombTeam = Team.All; public float TimeToExplote = 20f; public float TimeToActive = 7; public float TimeForNextRound = 5; public int XPForExplote = 200; [HideInInspector] public string ActorPlant = ""; [Header("Effects")] public GameObject BombObject; public GameObject ExplosionEffect; public AudioClip BipSound; public AudioClip ExplosionSound; public AudioSource Source; public Light RedLight; public AnimationCurve LightCurve; [Header("UI")] public GUISkin Skin; public Texture2D BackBar; public Texture2D BarTexture; private bl_GameManager GameManager; private bl_SettingPropiertis SettingsPropierties; private bool isBussy = false; private float TimeRemaing; private float TimeRemaingDesactive; private float countdown; private bool CanPlant = false; private bool CanDesactive = false; private float BarProgress; private float BarProgressDesactive; private bool Active = false; private bool BombDone = false; private bool RoundFinish = false; string lastWinner = ""; private string LastPlayerIn; private bool CanUseThis = true; private bl_BombDefuse[] AllBombs; /// /// /// void Awake() { GameManager = FindObjectOfType(); SettingsPropierties = FindObjectOfType(); GetBombs(); TimeRemaing = TimeToActive; BarProgress = TimeToActive; BarProgressDesactive = TimeToActive; countdown = TimeToExplote; Source.clip = BipSound; } void GetBombs() { AllBombs = FindObjectsOfType(); for(int i = 0; i < AllBombs.Length; i++) { AllBombs[i].ID = i; } } #region Triggers /// /// /// /// void OnTriggerEnter(Collider c) { if (isBussy) return; if (!CanUseThis) return; if (c.transform.tag == bl_PlayerSettings.LocalTag) { PhotonView v = c.gameObject.GetPhotonView(); if (v == null) { Debug.LogWarning("This object doesn't have a photonview"); } if (!Active) { if (v.owner.GetPlayerTeam() != BombTeam) { CanPlant = true; } } else { if (v.owner.GetPlayerTeam() == BombTeam) { CanDesactive = true; } } } } /// /// /// /// void OnTriggerExit(Collider c) { if (c.transform.tag == bl_PlayerSettings.LocalTag) { if (c.gameObject.name == ActorPlant) { photonView.RPC("StartPlantBomb", PhotonTargets.AllBuffered, false); } CanPlant = false; CanDesactive = false; } } #endregion /// /// /// void CountDown() { TimeRemaing -= 1; if (TimeRemaing <= 0) { CancelInvoke("CountDown"); TimeRemaing = 0; photonView.RPC("BombActive", PhotonTargets.AllBuffered, true,ID); } } /// /// /// void CountDownDesactive() { TimeRemaingDesactive -= 1; if (TimeRemaingDesactive <= 0) { CancelInvoke("CountDownDesactive"); TimeRemaingDesactive = 0; photonView.RPC("DesactiveBomb", PhotonTargets.AllBuffered); } } /// /// /// void Update() { if (BombDone) return; if (!CanUseThis) { CanPlant = false; Active = false; return; } if (CanPlant) { PlantLogic(); } if (CanDesactive) { DesactiveLogic(); } if (Active) { ActiveCountDown(); } LightControll(); } float lightAlpha; float curveTime; void LightControll() { if (Active) { curveTime += Time.deltaTime * 1.7f; lightAlpha = LightCurve.Evaluate(curveTime); } else { lightAlpha = Mathf.Lerp(lightAlpha, 0, Time.deltaTime * 2); } RedLight.intensity = lightAlpha; } /// /// /// private bool StartDesactive; void DesactiveLogic() { if (Input.GetKey(KeyCode.E) && CanDesactive) { if (!StartDesactive) { StartDesactive = true; photonView.RPC("StartDesactiveBomb", PhotonTargets.AllBuffered, true); } } else { if (StartDesactive) { StartDesactive = false; photonView.RPC("StartDesactiveBomb", PhotonTargets.AllBuffered, false); } TimeRemaingDesactive = TimeToActive; } } /// /// /// void ActiveCountDown() { countdown -= Time.deltaTime; if (countdown > 0) { if (!Source.isPlaying) { Source.PlayDelayed(0.8f); } } if (countdown <= 0) { countdown = 0; BombDone = true; StartCoroutine(ExplosionSecuence()); if (ActorPlant == PhotonNetwork.playerName) { PhotonNetwork.player.PostScore(XPForExplote); } } } /// /// /// void WonDone() { if (!PhotonNetwork.isMasterClient) return; int dscore = 0; Hashtable prod = new Hashtable(); if (this.BombTeam == Team.Recon) { dscore = (int)PhotonNetwork.room.CustomProperties[PropiertiesKeys.Team1Score]; dscore++; prod.Add(PropiertiesKeys.Team1Score, dscore); lastWinner = "Delta"; } else if (this.BombTeam == Team.Delta) { dscore = (int)PhotonNetwork.room.CustomProperties[PropiertiesKeys.Team2Score]; dscore++; prod.Add(PropiertiesKeys.Team2Score, dscore); lastWinner = "Recon"; } PhotonNetwork.room.SetCustomProperties(prod); } void WonDoneByDefuse() { if (!PhotonNetwork.isMasterClient) return; int dscore = 0; Hashtable prod = new Hashtable(); if (this.BombTeam == Team.Recon) { dscore = (int)PhotonNetwork.room.CustomProperties[PropiertiesKeys.Team2Score]; dscore++; prod.Add(PropiertiesKeys.Team2Score, dscore); lastWinner = "Recon"; } else if (this.BombTeam == Team.Delta) { dscore = (int)PhotonNetwork.room.CustomProperties[PropiertiesKeys.Team1Score]; dscore++; prod.Add(PropiertiesKeys.Team1Score, dscore); lastWinner = "Delta"; } PhotonNetwork.room.SetCustomProperties(prod); } /// /// /// void GetWinner(bool byDefuse = false) { if (this.BombTeam == Team.Recon) { lastWinner = (byDefuse) ? "Recon" : "Delta"; } else if (this.BombTeam == Team.Delta) { lastWinner = (byDefuse) ? "Delta" : "Recon"; } } private bool isStart = false; /// /// /// void PlantLogic() { if (Input.GetKey(KeyCode.E) && CanPlant) { if (!isStart) { isStart = true; photonView.RPC("StartPlantBomb", PhotonTargets.AllBuffered, true); } if (ActorPlant == LocalName) { } } else { if (isStart) { isStart = false; photonView.RPC("StartPlantBomb", PhotonTargets.AllBuffered, false); } TimeRemaing = TimeToActive; } } /// /// /// public void Reset() { countdown = TimeToExplote; TimeRemaing = TimeToActive; TimeRemaingDesactive = TimeToActive; BombDone = false; CanPlant = false; CanDesactive = false; isStart = false; isBussy = false; lightAlpha = 0; curveTime = 0; BombObject.SetActive(true); StartDesactive = false; RedLight.intensity = 0; Active = false; RoundFinish = false; CanUseThis = true; Debug.Log("Reset"); } public void PlayerReset() { CanPlant = false; CanDesactive = false; StartCoroutine(checkAgain()); } /// /// /// void OnGUI() { GUI.skin = Skin; if (!Active) { if (CanPlant && !isStart) { GUI.Label(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 50, 250, 50), "Press [E] to plant bomb!."); } if (isStart && CanPlant) { GUI.Label(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 50, 350, 70), "Activating bomb in: " + TimeRemaing.ToString("0.0")); BarProgress = Mathf.Lerp(BarProgress, (TimeRemaing - 1), Time.deltaTime / 2f); GUI.DrawTexture(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 110, TimeToActive * 30, 15), BackBar); GUI.DrawTexture(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 110, BarProgress * 30, 15), BarTexture); } } else { if (CanDesactive && !StartDesactive) { GUI.Label(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 50, 250, 50), "Press [E] to desactive the bomb!."); } if (CanDesactive && StartDesactive) { GUI.Label(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 50, 350, 70), "Desactive bomb in: " + TimeRemaingDesactive.ToString("0.0")); BarProgressDesactive = Mathf.Lerp(BarProgressDesactive, (TimeRemaingDesactive - 1), Time.deltaTime / 2f); GUI.DrawTexture(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 110, TimeToActive * 30, 15), BackBar); GUI.DrawTexture(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 110, BarProgressDesactive * 30, 15), BarTexture); } } if (Active && !RoundFinish) { GUI.color = (countdown <= 5) ? Color.red : Color.white; GUI.Label(new Rect(10, Screen.height - 175, 350, 50), BombTeam.ToString() + " Bomb will explode in: " + countdown.ToString("00.0")); GUI.color = Color.white; } GUI.depth = -600; if (RoundFinish) { GUI.Label(new Rect(Screen.width / 2 - 65, Screen.height / 2 + 10, 300, 70), "Team " + lastWinner + " Won!. \n \t Wait..."); } } #region RPCs /// /// /// /// /// [PunRPC] void StartPlantBomb(bool enter, PhotonMessageInfo sender) { ActorPlant = sender.sender.NickName; if (enter) { isBussy = true; if (sender.sender == PhotonNetwork.player) { InvokeRepeating("CountDown", 1, 1); } } else { isBussy = false; if (sender.sender == PhotonNetwork.player) { CancelInvoke("CountDown"); TimeRemaing = TimeToActive; BarProgress = TimeRemaing; } } } /// /// /// /// /// [PunRPC] void StartDesactiveBomb(bool enter, PhotonMessageInfo sender) { if (enter) { isBussy = true; if (sender.sender == PhotonNetwork.player) { InvokeRepeating("CountDownDesactive", 1, 1); } } else { isBussy = false; if (sender.sender == PhotonNetwork.player) { CancelInvoke("CountDownDesactive"); TimeRemaingDesactive = TimeToActive; BarProgressDesactive = TimeRemaingDesactive; } } } /// /// /// /// /// [PunRPC] void BombActive(bool act,int _id, PhotonMessageInfo sender) { if (act) { Active = true; isBussy = false; foreach(bl_BombDefuse bd in AllBombs) { bd.DesactiveOther(_id); } } else { Active = false; countdown = TimeToExplote; isBussy = false; } } [PunRPC] void DesactiveBomb(PhotonMessageInfo sender) { Reset(); StartCoroutine(BombDefuseSecuence()); if (sender.sender.NickName == PhotonNetwork.playerName) { PhotonNetwork.player.PostScore(XPForExplote); } } public void DesactiveOther(int theActive) { if (theActive == this.ID) return; CanUseThis = false; BombObject.SetActive(false); } #endregion #region Corrutines IEnumerator checkAgain() { yield return new WaitForSeconds(1); CanPlant = false; CanDesactive = false; } /// /// /// /// IEnumerator ExplosionSecuence() { AudioSource.PlayClipAtPoint(ExplosionSound, transform.position); GameObject e = Instantiate(ExplosionEffect, transform.position, Quaternion.identity) as GameObject; Destroy(e, 7); BombObject.SetActive(false); yield return new WaitForSeconds(1.2f); AudioSource.PlayClipAtPoint(ExplosionSound, transform.position); GameObject fe = Instantiate(ExplosionEffect, transform.position, Quaternion.identity) as GameObject; Destroy(fe, 7); StartCoroutine(GameManager.GetComponent().FadeIn()); yield return new WaitForSeconds(0.85f); if (PhotonNetwork.isMasterClient) { WonDone(); } else { GetWinner(); } RoundFinish = true; AudioSource.PlayClipAtPoint(ExplosionSound, transform.position); GameObject f = Instantiate(ExplosionEffect, transform.position, Quaternion.identity) as GameObject; Destroy(f, 7); //This is a good place for save info in your DataBase yield return new WaitForSeconds(TimeForNextRound); //If still missing rounds if (SettingsPropierties.CheckForBDRound) { foreach (bl_BombDefuse bd in AllBombs) { bd.Reset(); } GameManager.GetComponent().SpawnPlayer(PhotonNetwork.player.GetPlayerTeam()); } else//if rached max rounds { PhotonNetwork.LeaveRoom(); bl_UtilityHelper.LockCursor(false); } } /// /// /// /// IEnumerator BombDefuseSecuence() { if (PhotonNetwork.isMasterClient) { WonDoneByDefuse(); } else { GetWinner(true); } RoundFinish = true; StartCoroutine(GameManager.GetComponent().FadeIn()); yield return new WaitForSeconds(TimeForNextRound); //If still missing rounds if (SettingsPropierties.CheckForBDRound) { foreach (bl_BombDefuse bd in AllBombs) { bd.Reset(); } GameManager.GetComponent().SpawnPlayer(PhotonNetwork.player.GetPlayerTeam()); } else//if rached max rounds { PhotonNetwork.LeaveRoom(); bl_UtilityHelper.LockCursor(false); } } #endregion }

issues using namespaces

$
0
0
Hi, wondering if someone can spot what i am missing here.
I have three scripts.
Assets/Scripts/game.cs Assets/Scripts/Animals/cats.cs Assets/Scripts/Animals/dogs.cs
cats.cs contains namespace animals { public class cats { public static string sound = "meow"; } }
dogs.cs contains namespace animals { public class dogs { public static string sound = "woof"; } }
now i can access the sounds from game.cs with no problem public class game { private void make_sound() { Debug.Log(animals.cats.sound); Debug.Log(animals.dogs.sound); } }
but i cant seem to access the cat sound from within dog so the following does not seem to work namespace animals { public class dogs { public static string sound = "woof"; private void make_sound() { Debug.Log(animals.cats.sound); } } } I have tried adding using animals and using animals.cats but nothing seems to work.
Any idea what im doing wrong here?
thanks,

Namespace cannot be found

$
0
0
hello. so i have been looking around the net for a few days so i have seen the .Net version solution but it didn't help me. So here is the problem. I have made a dll, i have a reference to the dll (FluidStudios) the reference for the dll on the server side works just fine nothing goes wrong. when i try to reference the dll on the client side i face this problem. if i use the "using FluidStudios;" that becomes the error. if i do not, all the references to this throughout the script becomes the error. and a note, VS seems to see no problems with the using, or anything but unity does not accept it. here is the code:` using System.Collections; using System.Collections.Generic; using FluidStudios; using UnityEngine; using UnityEngine.UI; public class ClientData : MonoBehaviour { public static ClientData instance; public Network network; [Header("Login")] public Text _loginUsername; public Text _loginPassword; [Header("Registration")] public Text _username; public Text _password; public Text _password2; void Awake() { instance = this; } public void SendDataToServer(byte[] data) { FluidStudios.FluidStudios buffer = new FluidStudios.FluidStudios(); buffer.WriteBytes(data); network.myStream.Write(buffer.ToArray(), 0, buffer.ToArray().Length); buffer = null; } public void SendAccount() { FluidStudios.FluidStudios buffer = new FluidStudios.FluidStudios(); buffer.WriteInteger(1); if (_username.text == string.Empty) { Debug.Log("Please insert a username."); return; } if (_password.text == string.Empty) { Debug.Log("Please insert a password."); return; } if (_password2.text != _password.text) { Debug.Log("Your password do not match."); return; } buffer.WriteString(_username.text); buffer.WriteString(_password.text); SendDataToServer(buffer.ToArray()); buffer = null; } public void SendLogin() { FluidStudios.FluidStudios buffer = new FluidStudios.FluidStudios(); buffer.WriteInteger(2); if (_loginUsername.text == string.Empty) { Debug.Log("Please insert a username."); return; } if (_loginPassword.text == string.Empty) { Debug.Log("Please insert a password."); return; } buffer.WriteString(_loginUsername.text); buffer.WriteString(_loginPassword.text); SendDataToServer(buffer.ToArray()); buffer = null; } } `

References and Namespaces

$
0
0
Hi, My question is a little bit frustrating for me. Currently on my project there are two different Assembly definitions and 2 different namespaces. And my A.cs script is on my X namespace and Assembly-Csharp definition. And my B.cs script is on my Project namespace and Project-Assembly definition. What I am trying to do is, inside B script, I want to create a variable which is A.cs type but initially I can't. I tried to double click on my project assembly and i added Assembly-Csharp as a reference. I am able to Create a A type under my B until i save. Eventually it discards the reference adding after saving. Are there any options for this ? Thank you. Best regards.

How do I acquire the knowledge of every Unity namespace and every Unity capability at my disposal?

$
0
0
Im new to Unity and I understand the whole `using MagicalLibraryOfTools` syntax ..but i cannot find a list of all said magical libraries of predefined classes and their methods. I feel like a mother list like that would help me get a grasp on all the things i can do with Unity (that don't require me reinventing the wheel)

Missing Assembly References.

$
0
0
I recently acquired an addon for unity which I was very excited to use. However, it's causing all kinds of errors in the console and I was wondering if these errors were on my end? The addon is Aura 2, it was released only recently. I can't find any help for this issue, nobody seems to be having this problem. The errors are endless. Every time I attempt to manually remedy one an entire new string of them appear. This is just a few of them, the list really does go on and on though: "Assets/Aura 2/System/Code/Editor/Editors/AuraQualitySettingsEditor.cs(297,90): error CS1061: Type `UnityEditor.SerializedProperty' does not contain a definition for `vector3IntValue' and no extension method `vector3IntValue' of type `UnityEditor.SerializedProperty' could be found. Are you missing an assembly reference? Assets/Aura 2/System/Code/Editor/Editors/SceneViewToolbox.cs(1760,65): error CS1061: Type `UnityEngine.Plane' does not contain a definition for `ClosestPointOnPlane' and no extension method `ClosestPointOnPlane' of type `UnityEngine.Plane' could be found. Are you missing an assembly reference? Assets/Aura 2/System/Code/Editor/Editors/SceneViewToolbox.cs(1861,65): error CS1061: Type `UnityEngine.Plane' does not contain a definition for `ClosestPointOnPlane' and no extension method `ClosestPointOnPlane' of type `UnityEngine.Plane' could be found. Are you missing an assembly reference? Assets/Aura 2/System/Code/Editor/Editors/Texture3DTool.cs(233,61): error CS1061: Type `UnityEngine.Texture2D' does not contain a definition for `wrapModeU' and no extension method `wrapModeU' of type `UnityEngine.Texture2D' could be found. Are you missing an assembly reference? Assets/Aura 2/System/Code/Editor/Editors/Texture3DTool.cs(233,35): error CS1061: Type `UnityEngine.Texture3D' does not contain a definition for `wrapModeU' and no extension method `wrapModeU' of type `UnityEngine.Texture3D' could be found. Are you missing an assembly reference? Assets/Aura 2/System/Code/Editor/Editors/Texture3DTool.cs(234,61): error CS1061: Type `UnityEngine.Texture2D' does not contain a definition for `wrapModeV' and no extension method `wrapModeV' of type `UnityEngine.Texture2D' could be found. Are you missing an assembly reference? Assets/Aura 2/System/Code/Editor/Editors/Texture3DTool.cs(234,35): error CS1061: Type `UnityEngine.Texture3D' does not contain a definition for `wrapModeV' and no extension method `wrapModeV' of type `UnityEngine.Texture3D' could be found. Are you missing an assembly reference?"

Copilation error after adding namespaces.

$
0
0
So for starters, in the beginning my game worked fine. But then I added a new script, and if I try to use using UnityEngine.SceneManager; I get an compilation error "All compilation errors have to be fixed bevor entering game mode". I tried deleting the cript and creating a new one and if I dont edit it, it works fine, but if I try to use the namespace I get an error. I dont use the sript anywhere. Also I used the same Namespace in another script in the same Game, and there it is fine. This also happens if I try adding SceneManager.LoadScene... but not if I do stuff like creating an integer.

List of namespaces?

$
0
0
Is there somewhere a list out there of all existing "using Unity." namespaces? All the things you can access from? I fear I'm going to miss a hell lot of things, few minutes ago I found out about "using Unity.Entities" and how to access tilemaps and only out of pure chance. Unity documentation has only a definition but I can't find a list.

How to import microsoft.office.interop.excel.dll in Unity

$
0
0
I'm trying to create a program that read/writes an external excel file but i cant seem to use the microsoft.office.interop.excel namespace I've tried searching online but nothing works for me. Can someone help me out?

UnityEditor.iOS.Xcode does not exist

$
0
0
So I'm trying to use this: https://docs.unity3d.com/ScriptReference/iOS.Xcode.ProjectCapabilityManager.html _ **Step 1, add the using at the top...** _ ![alt text][1] ![alt text][2] _ **I have the iOS component installed (Unity 2018.2.1f1).** _ ![alt text][3] [1]: https://i.imgur.com/wclPLGK.png [2]: https://i.imgur.com/nq8ZcKO.png [3]: https://i.imgur.com/seNChPN.png

"Namespace Error" when there shouldn't be

$
0
0
Hi, I am new to Unity and C#. I have been working on this virtual reality game project for a while now (Oculus Quest) and I would like to get it to work. Since I switched to the Android platform I have been running into some namespace errors when I press "Build". Keep in mind that my code has worked perfectly before when clicking 'Play' both on Android and not. It is just errors when I press 'Build'. ![alt text][1] ![alt text][2] i Here is my code: using System; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.Windows.Speech; public class CommandBook : MonoBehaviour { private Dictionary keywordActions = new Dictionary(); private KeywordRecognizer keyword; private void Start() { keywordActions.Add("Hold", Levitate); keywordActions.Add("Thrusters Enguaged", Thrusters); keywordActions.Add("Fire", Cannon); keywordActions.Add("Lockdown", Spirit); keyword = new KeywordRecognizer(keywordActions.Keys.ToArray()); keyword.OnPhraseRecognized += OnKeywordsRecognized; keyword.Start(); } private void OnKeywordsRecognized(PhraseRecognizedEventArgs args) { //Debug.Log("Keyword: " + args.text); keywordActions[args.text].Invoke(); } public CommandActivation commands; public void Levitate() { print("Hovering"); } //Launches a projectile public void Thrusters() { print("Thrusters Enguaged"); } public void Cannon() { commands.cannonball(); print("Cannon Fired"); } public void Spirit() { print("Lockdown In Play"); } } i i Here is my code that is connected to my piece above: using UnityEngine; public class CommandActivation : MonoBehaviour { //Projectiles if there is any public Rigidbody CannonProjectile; public Transform tip; public void cannonball() { Rigidbody cannonproj; cannonproj = Instantiate(CannonProjectile, tip.position, tip.rotation) as Rigidbody; cannonproj.velocity = tip.forward * 50; } } i i Like I said it works just fine in the editor, but when I press 'Build' or 'Build and Run' it throws these errors at me. This is the core of my game and I have many many ideas orbiting this core mechanic. I had high hopes that this would work, so if anyone could help me I would be very happy. Thank you [1]: /storage/temp/139026-capture.png [2]: /storage/temp/139027-capture1.png

Access to a variable in namespace

$
0
0
I am working with the ml-agents-toolkit. WHat I want to do is, to change the graph model through the script. To do so I have to access a public variable in a namespace. It is here: https://github.com/Unity-Technologies/ml-agents/blob/master/UnitySDK/Assets/ML-Agents/Scripts/LearningBrain.cs#L42 I have tried something like this but it is wrong: `brain.coreBrain = (MLAgents.CoreBrain)Resources.Load("Assets/Resources/Models/Level2.bytes", typeof(MLAgents.CoreBrain));`
Viewing all 398 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>