Exemplo n.º 1
0
        public iAreaRange GetAreaRange(eAreaType areaType)
        {
            WeatherArea area  = m_script.Area;
            iAreaRange  range = area.GetAreaRange(areaType);

            if (range == null)
            {
                switch (areaType)
                {
                case eAreaType.Cube:
                    range = new CubeRange();
                    break;

                case eAreaType.Cylinder:
                    range = new CylinderRange();
                    break;

                case eAreaType.Sphere:
                    range = new SphereRange();
                    break;
                }
                area.SetAreaRange(areaType, range);
            }

            return(range);
        }
Exemplo n.º 2
0
        private void UpdateProperties_Cylinder()
        {
            CylinderRange range = GetAreaRange(eAreaType.Cylinder) as CylinderRange;

            range.AreaRadius    = EditorGUILayout.FloatField("区域半径", range.AreaRadius, m_options);
            range.AreaHeight    = EditorGUILayout.FloatField("区域高度", range.AreaHeight, m_options);
            range.BlendDistance = EditorGUILayout.FloatField("混合距离", range.BlendDistance, m_options);
            range.IgnoreHeight  = EditorGUILayout.Toggle("忽略高度", range.IgnoreHeight, m_options);
            if (range.GizmosMesh == null)
            {
                string     prefabPathName = "Assets/WeatherTest/Scripts/WeatherSystem/Cylinder.prefab";
                GameObject prefab         = AssetDatabase.LoadAssetAtPath <GameObject>(prefabPathName);
                MeshFilter filter         = prefab == null ? null : prefab.GetComponent <MeshFilter>();
                range.GizmosMesh = filter == null ? null : filter.sharedMesh;
            }
        }
Exemplo n.º 3
0
        public void SetAreaRange(eAreaType areaType, iAreaRange range)
        {
            switch (areaType)
            {
            case eAreaType.Global:
                m_globalRange = range as GlobalRange;
                break;

            case eAreaType.Cube:
                m_cubeRange = range as CubeRange;
                break;

            case eAreaType.Cylinder:
                m_cylinderRange = range as CylinderRange;
                break;

            case eAreaType.Sphere:
                m_sphereRange = range as SphereRange;
                break;
            }
        }