Unity-Technologies / FPSSample

A first person multiplayer shooter example project in Unity
https://unity.com/fps-sample
Other
4.85k stars 1.83k forks source link

Missing FPSSample menu, lots of compiler errors. #119

Open wbeyda opened 4 years ago

wbeyda commented 4 years ago

Steps to reproduce:

  1. install Unity 2018.3.8f1 from archives win10 latest updates.
  2. install git large file storage extension and configure for git
  3. git clone project (39.3GB on disk)
  4. create project from downloaded files and archived editor.
  5. wait for project to import assets.
  6. Project starts with missing menus and over 100+ compiler errors and missing packages.

An error occurred while resolving packages: Project has invalid dependencies: com.unity.cinemachine: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND). com.unity.mathematics: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND). com.unity.xr.oculus.standalone: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND). Package com.unity.entities@file:E:\Unity Games\FPSSample\Packages\com.unity.entities has invalid dependencies: com.unity.burst: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND). com.unity.collections: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND). com.unity.jobs: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND). com.unity.properties: Cannot connect to 'staging-packages.unity.com:443' (error code: ENOTFOUND).

A re-import of the project may be required to fix the issue or a manual modification of E:/Unity Games/FPSSample/Packages/manifest.json file.

arinssanghi commented 4 years ago

Same issue. Got any luck with it?

wbeyda commented 4 years ago

I got it to work but I can't remember all the stuff I did honestly. @arinssanghi

arinssanghi commented 4 years ago

Can you please help me out buddy?

arinssanghi commented 4 years ago

Anything at all?

arinssanghi commented 4 years ago

@wbeyda or can you send me your project with zero errors? Anything at all? Any help?

wbeyda commented 4 years ago

Here is my manifest. Uninstall all the packages that don't match the versions on here

{ "dependencies": { "com.unity.ads": "2.3.1", "com.unity.analytics": "3.2.2", "com.unity.cinemachine": "2.1.13", "com.unity.collab-proxy": "1.2.15", "com.unity.entities": "0.0.12-preview.24", "com.unity.mathematics": "1.0.0-preview.1", "com.unity.package-manager-ui": "2.0.3", "com.unity.postprocessing": "2.1.2", "com.unity.purchasing": "2.0.3", "com.unity.render-pipelines.core": "4.6.0-preview", "com.unity.render-pipelines.high-definition": "4.6.0-preview", "com.unity.scriptablebuildpipeline": "1.1.1-preview", "com.unity.shadergraph": "4.6.0-preview", "com.unity.textmeshpro": "1.3.0", "com.unity.visualeffectgraph": "4.8.0-preview", "com.unity.xr.oculus.standalone": "1.29.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", "com.unity.modules.cloth": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.particlesystem": "1.0.0", "com.unity.modules.physics": "1.0.0", "com.unity.modules.physics2d": "1.0.0", "com.unity.modules.screencapture": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.terrainphysics": "1.0.0", "com.unity.modules.tilemap": "1.0.0", "com.unity.modules.ui": "1.0.0", "com.unity.modules.uielements": "1.0.0", "com.unity.modules.umbra": "1.0.0", "com.unity.modules.unityanalytics": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.modules.vehicles": "1.0.0", "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" } }

arinssanghi commented 4 years ago

I tried this. I installed the packages. But I am creating new errors now @wbeyda

arinssanghi commented 4 years ago

@wbeyda Hey! Things finally worked!

I am only getting one error now

Assets\VFX\VisualEffectGraph-Extras\Editor\Utility\VFXEventTester\VFXEventTesterWindow.cs(17,16): error CS0246: The type or namespace name 'VisualEffect' could not be found (are you missing a using directive or an assembly reference?)

Any idea how to get rid of this last one? Thank you so much for your help!

arinssanghi commented 4 years ago

using UnityEngine; using UnityEngine.Experimental.VFX; using UnityEditorInternal; using System.Collections.Generic;

namespace UnityEditor.VFX.Utils { static class VFXEventTesterWindow { public static bool Visible;

    [SerializeField]
    static string m_CustomEvent = "CustomEvent";
    [SerializeField]
    static List<EventAttribute> m_Attributes;

    static VisualEffect m_Effect;
    static ReorderableList list;
    static readonly string PreferenceName = "VFXEventTester.Visible";

    static VFXEventTesterWindow()
    {
        m_Attributes = new List<EventAttribute>();

        Visible = EditorPrefs.GetBool(PreferenceName, false);

        list = new ReorderableList(m_Attributes, typeof(EventAttribute), true, true, true, true);
        list.drawHeaderCallback = drawHeader;
        list.drawElementCallback = drawItem;
        list.onAddDropdownCallback = drawAddDropDown;
    }

    [MenuItem("Edit/VisualEffect/Show Event Tester", validate = false, priority = 320)]
    static void ToggleVisibility()
    {
        Visible = !Visible;
        EditorPrefs.SetBool(PreferenceName, Visible);

        UpdateVisibility();
    }

    [MenuItem("Edit/Visual Effects/Show Event Tester", validate = true, priority = 320)]
    static bool CheckToggleVisibility()
    {
        Visible = EditorPrefs.GetBool(PreferenceName, Visible);
        Menu.SetChecked("Edit/Visual Effects/Show Event Tester", Visible);
        return true;
    }

    [InitializeOnLoadMethod]
    static void UpdateVisibility()
    {
        if (Visible)
            SceneView.onSceneGUIDelegate += DrawWindow;
        else
            SceneView.onSceneGUIDelegate -= DrawWindow;

    }

    private static void drawAddDropDown(Rect buttonRect, ReorderableList list)
    {
        GenericMenu menu = new GenericMenu();
        // Add Generic Attributes
        menu.AddItem(new GUIContent("Standard/Position"), false, AddVector3, "position");
        menu.AddItem(new GUIContent("Standard/Velocity"), false, AddVector3, "velocity");
        menu.AddItem(new GUIContent("Standard/Size"), false, AddFloat, "size");
        menu.AddItem(new GUIContent("Standard/Mass"), false, AddFloat, "mass");
        menu.AddItem(new GUIContent("Standard/Color"), false, AddColor, "color");
        menu.AddItem(new GUIContent("Standard/Alpha"), false, AddFloat, "alpha");
        menu.AddItem(new GUIContent("Standard/Age"), false, AddFloat, "age");
        menu.AddItem(new GUIContent("Standard/Lifetime"), false, AddFloat, "lifetime");
        menu.AddItem(new GUIContent("Standard/Alive"), false, AddBool, "alive");
        menu.AddItem(new GUIContent("Standard/Scale.X"), false, AddFloat, "scaleX");
        menu.AddItem(new GUIContent("Standard/Scale.Y"), false, AddFloat, "scaleY");
        menu.AddItem(new GUIContent("Standard/Scale.Z"), false, AddFloat, "scaleZ");
        menu.AddItem(new GUIContent("Standard/Angle.X"), false, AddFloat, "angleX");
        menu.AddItem(new GUIContent("Standard/Angle.Y"), false, AddFloat, "angleY");
        menu.AddItem(new GUIContent("Standard/Angle.Z"), false, AddFloat, "angleZ");
        // Add Advanced Attributes
        menu.AddItem(new GUIContent("Advanced/OldPosition"), false, AddVector3, "oldPosition");
        menu.AddItem(new GUIContent("Advanced/TargetPosition"), false, AddVector3, "targetPosition");
        menu.AddItem(new GUIContent("Advanced/Direction"), false, AddVector3, "direction");
        menu.AddItem(new GUIContent("Advanced/AngularVelocity.X"), false, AddFloat, "angularVelocityX");
        menu.AddItem(new GUIContent("Advanced/AngularVelocity.Y"), false, AddFloat, "angularVelocityY");
        menu.AddItem(new GUIContent("Advanced/AngularVelocity.Z"), false, AddFloat, "angularVelocityZ");
        // Add Generic Attributes
        menu.AddItem(new GUIContent("Custom/Custom bool"), false, AddBool, "customBool");
        menu.AddItem(new GUIContent("Custom/Custom Float"), false, AddFloat, "customFloat");
        menu.AddItem(new GUIContent("Custom/Custom Vector2"), false, AddVector2, "customVector2");
        menu.AddItem(new GUIContent("Custom/Custom Vector3"), false, AddVector3, "customVector3");
        menu.AddItem(new GUIContent("Custom/Custom Color"), false, AddColor, "customColor");

        // Add Custom Types
        menu.ShowAsContext();
    }

    static void AddFloat(object name)
    {
        m_Attributes.Add(new EventAttribute(name as string, EventAttributeType.Float, 0.0f));
    }

    static void AddBool(object name)
    {
        m_Attributes.Add(new EventAttribute(name as string, EventAttributeType.Bool, true));
    }

    static void AddVector2(object name)
    {
        m_Attributes.Add(new EventAttribute(name as string, EventAttributeType.Vector2, Vector2.zero));
    }

    static void AddVector3(object name)
    {
        m_Attributes.Add(new EventAttribute(name as string, EventAttributeType.Vector3, Vector3.zero));
    }

    static void AddColor(object name)
    {
        m_Attributes.Add(new EventAttribute(name as string, EventAttributeType.Color, Color.white));
    }

    static void DrawWindow(SceneView sceneView)
    {
        if (Selection.activeGameObject != null)
        {
            var component = Selection.activeGameObject.GetComponent<VisualEffect>();
            if (component != null)
            {
                m_Effect = component;
                SceneViewOverlay.Window(Contents.title, WindowFunction, 601, SceneViewOverlay.WindowDisplayOption.OneWindowPerTitle);
            }
            else
            {
                m_Effect = null;
            }
        }
    }

    static void WindowFunction(UnityEngine.Object target, SceneView sceneView)
    {
        WindowGUI();
    }

    [System.Serializable]
    enum EventAttributeType
    {
        Float = 0,
        Vector2 = 1,
        Vector3 = 2,
        Color = 3,
        Bool = 4
    }

    [System.Serializable]
    class EventAttribute
    {
        public string name;
        public EventAttributeType type;
        public object value;

        public EventAttribute()
        {
            name = "Attribute";
            type = EventAttributeType.Float;
            value = 0.0f;
        }

        public EventAttribute(string name, EventAttributeType type, object value)
        {
            this.name = name;
            this.type = type;
            this.value = value;
        }
    }

    private static void drawHeader(Rect rect)
    {
        GUI.Label(rect, "Event Attributes");
    }

    static void drawItem(Rect rect, int index, bool isActive, bool isFocused)
    {
        if (m_Attributes[index] == null)
        {
            var color = GUI.color;
            GUI.color = Color.red;
            EditorGUI.LabelField(rect, "NULL OR DELETED");
            GUI.color = color;
            return;
        }

        rect.yMin += 2;
        rect.height = 16;

        var namerect = rect;
        namerect.width = 100;

        m_Attributes[index].name = GUI.TextField(namerect, m_Attributes[index].name);

        var typerect = rect;
        typerect.xMin = rect.xMin + 108;
        typerect.width = 64;
        m_Attributes[index].type = (EventAttributeType)EditorGUI.EnumPopup(typerect, m_Attributes[index].type);

        var valueRect = rect;
        valueRect.xMin = rect.xMin + 180;
        switch (m_Attributes[index].type)
        {
            case EventAttributeType.Bool:
                if (m_Attributes[index].value == null || !(m_Attributes[index].value is bool))
                    m_Attributes[index].value = true;

                m_Attributes[index].value = (bool)EditorGUI.Toggle(valueRect, (bool)m_Attributes[index].value);
                break;

            case EventAttributeType.Float:
                if (m_Attributes[index].value == null || !(m_Attributes[index].value is float))
                    m_Attributes[index].value = 1.0f;

                m_Attributes[index].value = (float)EditorGUI.FloatField(valueRect, (float)m_Attributes[index].value);
                break;

            case EventAttributeType.Vector2:
                if (m_Attributes[index].value == null || !(m_Attributes[index].value is Vector2))
                    m_Attributes[index].value = Vector2.zero;

                m_Attributes[index].value = (Vector2)EditorGUI.Vector2Field(valueRect, "", (Vector2)m_Attributes[index].value);
                break;

            case EventAttributeType.Vector3:
                if (m_Attributes[index].value == null || !(m_Attributes[index].value is Vector3))
                    m_Attributes[index].value = Vector3.zero;

                m_Attributes[index].value = (Vector3)EditorGUI.Vector3Field(valueRect, "", (Vector3)m_Attributes[index].value);
                break;

            case EventAttributeType.Color:
                if (m_Attributes[index].value == null || !(m_Attributes[index].value is Color))
                    m_Attributes[index].value = Color.white;

                m_Attributes[index].value = (Color)EditorGUI.ColorField(valueRect, (Color)m_Attributes[index].value);
                break;
        }
    }

    static void WindowGUI()
    {
        EditorGUI.BeginDisabled(m_Effect == null);
        EditorGUILayout.Space();
        list.DoLayoutList();
        EditorGUILayout.Space();
        using (new GUILayout.HorizontalScope(GUILayout.Width(360)))
        {
            if (GUILayout.Button("Play", Styles.leftButton, GUILayout.Height(24)))
            {
                SendEvent("OnPlay");
            }
            if (GUILayout.Button("Stop", Styles.middleButton, GUILayout.Height(24)))
            {
                SendEvent("OnStop");
            }
            if (GUILayout.Button("Custom", Styles.rightButton, GUILayout.Height(24)))
            {
                SendEvent(m_CustomEvent);
            }
        }
        m_CustomEvent = EditorGUILayout.TextField("Custom Event", m_CustomEvent);
        EditorGUI.EndDisabled();
    }

    static void SendEvent(string name)
    {
        if (m_Effect == null) return;
        var attrib = m_Effect.CreateVFXEventAttribute();

        // set all attributes
        foreach (var attribute in m_Attributes)
        {
            if (attribute == null) continue;
            switch (attribute.type)
            {
                case EventAttributeType.Bool: attrib.SetBool(attribute.name, (bool)attribute.value); break;
                case EventAttributeType.Float: attrib.SetFloat(attribute.name, (float)attribute.value); break;
                case EventAttributeType.Vector2: attrib.SetVector2(attribute.name, (Vector2)attribute.value); break;
                case EventAttributeType.Vector3: attrib.SetVector3(attribute.name, (Vector3)attribute.value); break;
                case EventAttributeType.Color: attrib.SetVector4(attribute.name, (Color)attribute.value); break;
            }
        }

        // then send event with attributes
        if (name == "OnPlay")
            m_Effect.Play(attrib);
        else if (name == "OnStop")
            m_Effect.Stop(attrib);
        else
            m_Effect.SendEvent(name, attrib);

    }

    static class Contents
    {
        public static readonly GUIContent title = new GUIContent("VFX Event Tester");
    }

    static class Styles
    {
        public static GUIStyle leftButton;
        public static GUIStyle middleButton;
        public static GUIStyle rightButton;

        static Styles()
        {
            leftButton = new GUIStyle(EditorStyles.miniButtonLeft);
            middleButton = new GUIStyle(EditorStyles.miniButtonMid);
            rightButton = new GUIStyle(EditorStyles.miniButtonRight);
            leftButton.fontSize = 12;
            middleButton.fontSize = 12;
            rightButton.fontSize = 12;
        }
    }

}

}

lvchy commented 4 years ago

ArgumentException: Kernel 'KSampleCopy4_1_x_8' not found. UnityEngine.Experimental.Rendering.GPUCopy..ctor (UnityEngine.ComputeShader shader) (at Packages/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/GPUCopy.cs:16) UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline..ctor (UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipelineAsset asset) (at Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs:259) UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipelineAsset.InternalCreatePipeline () (at Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs:23) UnityEngine.Experimental.Rendering.RenderPipelineAsset.CreatePipeline () (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineAsset.cs:19) UnityEngine.Experimental.Rendering.RenderPipelineManager.PrepareRenderPipeline (UnityEngine.Experimental.Rendering.IRenderPipelineAsset pipe) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:55) UnityEngine.Experimental.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Experimental.Rendering.IRenderPipelineAsset pipe, UnityEngine.Camera[] cameras, System.IntPtr loopPtr) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:28)

I got these error in editor every time after change manifest