Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

A namespace cannot directly contain members such as field and methods.

Discussion in 'Getting Started' started by Wasdert554411, Apr 10, 2024.

  1. Wasdert554411

    Wasdert554411

    Joined:
    Mar 20, 2024
    Posts:
    1
    hi there. i had this issue since a while now and i dont know how to fix it. can anybody please help me or send the correct code? ive searched the whole internet but didnt found anything. im new to coding.

    csharp
    using System;
    using UnityEngine;

    namespace VLB
    {
    [Serializable]
    public struct MinMaxRangeFloat
    {
    [SerializeField]
    private float m_MinValue;

    [SerializeField]
    private float m_MaxValue;

    public float minValue => 0f;
    public float maxValue => 0f;
    public float randomValue => 0f;
    public Vector2 asVector2 => default(Vector2);

    public float GetLerpedValue(float lerp01)
    {
    return 0f;
    }

    public MinMaxRangeFloat(float min, float max)
    {
    }
    }
    }
     
    Last edited: Apr 10, 2024
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,625