public void Initialize(Color diffuseColor, float roughness, float metalness, Texture2D albedoMap = null, Texture2D normalMap = null, Texture2D roughnessMap = null, Texture2D metallicMap = null, Texture2D mask = null, Texture2D displacementMap = null, MaterialTypes type = MaterialTypes.Basic, float emissiveStrength = 0)
        {
            DiffuseColor = diffuseColor.ToVector3();
            Roughness    = roughness;
            Metallic     = metalness;

            AlbedoMap       = albedoMap;
            NormalMap       = normalMap;
            RoughnessMap    = roughnessMap;
            MetallicMap     = metallicMap;
            DisplacementMap = displacementMap;
            Mask            = mask;
            Type            = type;

            if (emissiveStrength > 0)
            {
                //Type = MaterialTypes.Emissive;
                EmissiveStrength = emissiveStrength;
            }
        }
Exemple #2
0
    public DrawTool()
    {
        canDraw        = true;
        drawStr        = HexSize.normal;
        multCellRadius = 0;
        scroll         = 0;
        currMode       = DrawMode.Height;
        currType       = MaterialTypes.Grass;
        currTypeInt    = 0;

        buttonGet    = GameObject.Find("Tile Height Button");
        heightButton = buttonGet.GetComponent <Button>();
        heightButton.onClick.AddListener(HeightButtonTask);

        buttonGet  = GameObject.Find("Tile Type Button");
        typeButton = buttonGet.GetComponent <Button>();
        typeButton.onClick.AddListener(TypeButtonTask);

        //Everytime a material type is added to the enum, update this.
        tileTypeMax = 2; //int of last enum in MaterialTypes
    }
Exemple #3
0
    public List <BuildingMaterial> GetMaterial(MaterialTypes materialType)
    {
        List <BuildingMaterial> temp = new List <BuildingMaterial>();

        foreach (var item in CurrentCubes)
        {
            if (item.Value.CurrentUpgradeType == CubeUpgradeTypes.StoreHouse)
            {
                // Check store house for material
                StoreHouse store = (StoreHouse)item.Value.CurrentUpgrade;
                for (int i = 0; i < store.StoredResources.Count; i++)
                {
                    for (int x = 0; x < store.StoredResources[i].Count; x++)
                    {
                        if (store.StoredResources[i][x].MaterialType == materialType)
                        {
                            temp.Add(store.StoredResources[i][x]);
                        }
                    }
                }
            }
        }
        return(temp);
    }
Exemple #4
0
        public override bool Equals(object obj)
        {
            if (!(obj is BaseMaterial target))
            {
                return(false);
            }

            if (Modifier != target.Modifier)
            {
                return(false);
            }

            if (MaterialName != target.MaterialName)
            {
                return(false);
            }

            if (!MaterialTypes.SequenceEqual(target.MaterialTypes))
            {
                return(false);
            }

            return(true);
        }
Exemple #5
0
    public void SpawnHole(RaycastHit hit)

    {
        Vector3 pos = hit.point + hit.normal * 0.01f;

        Quaternion rot = Quaternion.FromToRotation(Vector3.up, hit.normal);

        int i = 0;

        GameObject newHole;

        MaterialTypes mat = MaterialTypes.UNKNOWN;



        switch (hit.transform.tag)

        {
        case "Wood":

            mat = MaterialTypes.WOOD;

            break;

        default:

            mat = MaterialTypes.UNKNOWN;

            break;
        }



        switch (mat)

        {
        case MaterialTypes.METAL:

            i = Random.Range(0, metalHoles.Count);

            newHole = ObjectPool.pool.GetObjectForType(metalHoles[i].name, false);

            newHole.transform.position = pos;

            newHole.transform.rotation = rot;

            break;

        case MaterialTypes.STONE:

            i = Random.Range(0, stoneHoles.Count);

            newHole = ObjectPool.pool.GetObjectForType(stoneHoles[i].name, false);

            newHole.transform.position = pos;

            newHole.transform.rotation = rot;

            break;

        case MaterialTypes.WOOD:

            i = Random.Range(0, woodHoles.Count);

            newHole = ObjectPool.pool.GetObjectForType(woodHoles[i].name, false);

            newHole.transform.position = pos;

            newHole.transform.rotation = rot;

            break;

        default:

            i = Random.Range(0, holes.Count);

            newHole = ObjectPool.pool.GetObjectForType(holes[i].name, false);

            newHole.transform.position = pos;

            newHole.transform.rotation = rot;

            break;
        }



        newHole.transform.parent = transform;

        activeHoles.Add(newHole);
    }
Exemple #6
0
 /// <summary>
 /// Set the MaterialType
 /// </summary>
 public void setMaterialType(MaterialTypes _MaterialTypes)
 {
     SelectedMaterialType = _MaterialTypes;
 }
 /// <summary>
 /// Sets TAS Material Type
 /// </summary>
 /// <param name="Material">Material</param>
 /// <param name="MaterialTypes">Material Type</param>
 /// <returns name="Material">Material</returns>
 /// <search>
 /// TAS, Material, material, Type, type, SetType, settype, Set Type, set type
 /// </search>
 public static Material SetType(Material Material, MaterialTypes MaterialTypes)
 {
     Material.pMaterial.type = (int)MaterialTypes;
     return(Material);
 }
 public frmMaterialShow(MaterialTypes type, bool available)
 {
     InitializeComponent();
     _type        = type;
     _isAvailable = available;
 }
        public IDictionary <string, string> GetMaterialProperties(MaterialTypes materialType, Guid materialId)
        {
            var       dictionary = new Dictionary <string, string>();
            var       holder     = Resolver.Resolve <IRisa3DMetadataHolder>();
            GridCodes gridCode   = GridCodes.NONE;

            switch (materialType)
            {
            case MaterialTypes.HOT_ROLLED_STEEL_MATL:
                gridCode = GridCodes.HRSTL_GRID_NUMBER;
                break;

            case MaterialTypes.COLD_FORMED_STEEL_MATL:
                gridCode = GridCodes.CFSTL_GRID_NUMBER;
                break;

            case MaterialTypes.ALUMINUM_MATL:
                gridCode = GridCodes.AL_MATL_GRID_NUMBER;
                break;

            case MaterialTypes.CONCRETE_MATL:
                gridCode = GridCodes.CONC_MATL_GRID_NUMBER;
                break;

            case MaterialTypes.NDS_WOOD_MATL:
                gridCode = GridCodes.WOOD_PROP_GRID_NUMBER;
                break;

            case MaterialTypes.STAINLESS_STEEL_MATL:
                gridCode = GridCodes.SS_GRID_NUMBER;
                break;

            case MaterialTypes.GENERAL_MATL:
                gridCode = GridCodes.MATL_GRID_NUMBER;
                break;
            }

            var propertyInfoHolders = holder.GetGridProperty(Risa3DTypeKind.SpreadsheetModel, gridCode);

            foreach (var propertyInfo in propertyInfoHolders)
            {
                if (propertyInfo.ColumnIndex >= 0)
                {
                    var name = (propertyInfo.GetAttribute(typeof(PropertyTitleAttribute)) as PropertyTitleAttribute)?.Title;
                    if (propertyInfo.Name == "Label")
                    {
                        name = "Material";
                    }

                    var units = string.Empty;
                    if (propertyInfo.HasAttribute(typeof(UnitLabelAttribute)))
                    {
                        units = (propertyInfo.GetAttribute(typeof(UnitLabelAttribute)) as UnitLabelAttribute)?.TitleSuffix;
                    }
                    else if (propertyInfo.HasAttribute(typeof(CompositeUnitLabelAttribute)))
                    {
                        units = (propertyInfo.GetAttribute(typeof(CompositeUnitLabelAttribute)) as CompositeUnitLabelAttribute)?.TitleSuffix;
                    }

                    if (!string.IsNullOrEmpty(units))
                    {
                        units = $" ({units})";
                    }

                    var value = " "; // DetailReportService.GetMaterialValues(materialId, gridCode, propertyInfo.ColumnIndex);

                    dictionary.Add($"{name}{units}:", value);
                }
            }

            return(dictionary);
        }
Exemple #10
0
        public MaterialTypes Get(Int64 ixMaterialType)
        {
            MaterialTypes materialtypes = _context.MaterialTypes.AsNoTracking().Where(x => x.ixMaterialType == ixMaterialType).First();

            return(materialtypes);
        }
        /// <summary>
        /// 캐시에서 가격 가져오기
        /// </summary>
        /// <param name="materialType"></param>
        /// <returns></returns>
        private decimal GetMaterailByCache(MaterialTypes materialType)
        {
            string key = "MaterialTypes/" + materialType.ToString();

            return(cache.GetCache(key));
        }
        /// <summary>
        /// 캐시에 가격 기록
        /// </summary>
        /// <param name="materialType"></param>
        /// <param name="val"></param>
        private void SetMaterailCache(MaterialTypes materialType, decimal val)
        {
            string key = "MaterialTypes/" + materialType.ToString();

            cache.Set(key, val);
        }
        public MaterialEffect(Effect cloneSource) : base(cloneSource)
        {
#if FORWARDONLY
            Type = MaterialTypes.ForwardShaded;
#endif
        }
 /// <summary>
 /// Set the default material generator for a material type.
 /// </summary>
 /// <param name="type">Material type to set.</param>
 /// <param name="generator">Generator function to use on this material.</param>
 static public void SetDefaultMaterialGenerator(MaterialTypes type, MaterialGenerator generator)
 {
     generators[(int)type] = generator;
 }
Exemple #15
0
 public Armour(ArmorClasses armorClass, WornPosition worn, string name, ItemTypes type, MaterialTypes material, int weight, List <Effect> effects)
     : base(name, type, material, weight, effects)
 {
     ArmourClass  = armorClass;
     WornPosition = worn;
 }
Exemple #16
0
        /// <summary>
        /// Method for load figures from xml file and parsing by XmlWriter
        /// </summary>
        /// <param name="filename"></param>
        public void ReadFiguresByXmlReader(string filename)
        {
            XmlReader reader = XmlReader.Create(filename);

            while (reader.Read())
            {
                if (reader.Name == "figure")
                {
                    XmlDocument document = new XmlDocument();
                    document.LoadXml(reader.ReadOuterXml());
                    XmlNode node           = document.SelectSingleNode("figure");
                    XmlNode figureTypeNode = node.SelectSingleNode("figuretype");
                    XmlNode colorNode      = node.SelectSingleNode("color");
                    XmlNode materialNode   = node.SelectSingleNode("material");

                    Colors        color        = (Colors)Enum.Parse(typeof(Colors), colorNode.InnerText);
                    MaterialTypes materialType = (MaterialTypes)Enum.Parse(typeof(MaterialTypes), materialNode.InnerText);
                    Material      material     = new Material(materialType);

                    if (figureTypeNode.InnerText == "Square")
                    {
                        XmlNode squareSideNode = node.SelectSingleNode("a");
                        double  squareSide     = Convert.ToDouble(squareSideNode.InnerText);

                        Square square = new Square(material, squareSide);
                        if (materialType == MaterialTypes.Paper)
                        {
                            square.Material.Paint(color);
                        }

                        figures.Add(square);
                    }
                    if (figureTypeNode.InnerText == "Circle")
                    {
                        XmlNode circleRadiusNode = node.SelectSingleNode("radius");
                        double  circleRadius     = Convert.ToDouble(circleRadiusNode.InnerText);

                        Circle circle = new Circle(material, circleRadius);
                        if (materialType == MaterialTypes.Paper)
                        {
                            circle.Material.Paint(color);
                        }

                        figures.Add(circle);
                    }
                    if (figureTypeNode.InnerText == "Triangle")
                    {
                        XmlNode triangleSideNode   = node.SelectSingleNode("a");
                        XmlNode triangleHeightNode = node.SelectSingleNode("height");
                        double  triangleSide       = Convert.ToDouble(triangleSideNode.InnerText);

                        Triangle triangle = new Triangle(material, triangleSide);
                        if (material.MaterialType == MaterialTypes.Paper)
                        {
                            triangle.Material.Paint(color);
                        }

                        figures.Add(triangle);
                    }
                }
            }
        }
 public MaterialItem Get(MaterialTypes materialType)
 {
     return(service.GetByType(materialType));
 }
Exemple #18
0
 protected MaterialBase(MaterialTypes type)
 {
     m_type = type;
 }
Exemple #19
0
 public Shield(ArmorClasses armorClass, string name, ItemTypes type, MaterialTypes material, int weight, List <Effect> effects)
     : base(name, type, material, weight, effects)
 {
 }
Exemple #20
0
    void OnGUI()
    {
        //To fix the crapy static stuff and missing Start void :/
        if (firstStart == false)
        {
            firstStart = true;
            importSettingsFromExistingManager();

            if (SelectedObject != null)
            {
                importSettingsFromSelectedGameObject();
            }
        }

        //To keep everything updated!
        NoneGUIElementsUpdate();

        if (OverWriteDisableWindow == false)        // If this value = true there is something wrong!
        {
            if (ShowAdvancedInfo == true)
            {
                if (GUILayout.Button("Hide advanced options/info"))
                {
                    ShowAdvancedInfo = false;;
                    hideManagerGameObject();
                }
            }
            else
            {
                if (GUILayout.Button("Show advanced options/info"))
                {
                    ShowAdvancedInfo = true;
                    showManagerGameObject();
                }
            }

            if (textureLogo == null)
            {
                textureLogo = (Texture2D)EditorGUIUtility.Load("Assets/RealisticPhysics/RealisticWaterPhysics/Resources/icon0.png");
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(textureLogo);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            toolbarInt = GUILayout.Toolbar(toolbarInt, toolbarStrings);

            EditorGUILayout.BeginHorizontal();
            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(450), GUILayout.Height(300));
        }

        EditorGUILayout.HelpBox("Waring log: " + lastErrorLog, MessageType.Info, true); //Desplay the last error log, warning!

        if (OverWriteDisableWindow == false)                                            // If this value = true there is something wrong!
        {
            EditorGUILayout.Space();
            if (showSetupOptions == true)
            {
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Water settings:");
                selectedOceanLiquidsMaterial = (LiquidsMaterialList)EditorGUILayout.EnumPopup("Water Classification:", selectedOceanLiquidsMaterial);

                if (ShowAdvancedInfo)
                {
                    EditorGUILayout.LabelField("Density of the water:" + CalculatedWaterDensity);
                }
                EditorGUILayout.Space();

                if (waterObject != null)
                {
                    waterLevel = waterObject.transform.position.y;
                }

                if (currentUseCeto == false && currentUseDW == false && currentUseAquas == false && currentUsePlayWayWater == false)
                {
                    if (waterObject == null)
                    {
                        waterLevel = EditorGUILayout.FloatField("Water Level:", waterLevel);
                    }
                    if (ShowAdvancedInfo)
                    {
                        if (waterObject == null)
                        {
                            EditorGUILayout.LabelField("Or");
                        }
                        if (waterObject = EditorGUILayout.ObjectField("Water GameObject: ", waterObject, typeof(GameObject), true) as GameObject)
                        {
                            waterLevel = waterObject.transform.position.y;
                            EditorGUILayout.BeginHorizontal();
                            EditorGUILayout.LabelField("");
                            EditorGUILayout.LabelField("Water level: " + waterLevel.ToString());
                            EditorGUILayout.EndHorizontal();
                        }
                        EditorGUILayout.LabelField("Or");
                        useExternalWaterLevel = EditorGUILayout.Toggle("Use external water level", useExternalWaterLevel);                         // Allows you to make something yourself ;)
                    }
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Air settings:");
                useAirDensity = EditorGUILayout.Toggle("Use air density", useAirDensity);
                if (useAirDensity == true)
                {
                    maxAirLevel = EditorGUILayout.FloatField("Max air Level:", maxAirLevel);
                    if (ShowAdvancedInfo)
                    {
                        selectedAirGasesMaterial = (GasesMaterialList)EditorGUILayout.EnumPopup("Air type: ", selectedAirGasesMaterial);
                        airDensity = PhysicsMaterialsList.getGasesMaterialValue(selectedAirGasesMaterial);
                        EditorGUILayout.LabelField("Density of the air:" + CalculatedAirDensity);                         // work in progress!
                    }
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Support settings:");

                //Again for support
                                #if CETO
                currentUseCeto = EditorGUILayout.Toggle("Enable Ceto support", currentUseCeto);
                                #endif

                                #if DW
                currentUseDW = EditorGUILayout.Toggle("Enable Dynamic Water support", currentUseDW);
                                #endif

                                #if AQUAS
                currentUseAquas = EditorGUILayout.Toggle("Enable Aquas support", currentUseAquas);
                                #endif
                //Aquas needs a water level to work with, so leave that at them, just let the users select the aqaus water object
                if (currentUseAquas == true)
                {
                    if (AquaswaterObject = EditorGUILayout.ObjectField("AQUAS water object: ", AquaswaterObject, typeof(GameObject), true) as GameObject)
                    {
                        waterLevel = AquaswaterObject.transform.position.y;
                    }
                    if (AquaswaterObject != null)
                    {
                        waterLevel = AquaswaterObject.transform.position.y;
                    }
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("");
                    EditorGUILayout.LabelField("Water level: " + waterLevel.ToString());
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Space();
                }


                                #if PW
                currentUsePlayWayWater = EditorGUILayout.Toggle("Enable PlayWay Water support", currentUsePlayWayWater);
                                #endif

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Read the Manual for more info.");
                //get some room!
                EditorGUILayout.Space();
                EditorGUILayout.Space();
                EditorGUILayout.Space();
            }

            if (showGameobjectSetupOptions == true)
            {
                if (selectionGameObjects.Count > 0)
                {
                    EditorGUILayout.LabelField("All Gameobjects below will get the same settings!");
                    SelectedObject = selectionGameObjects[0];

                    for (int i = 0; i < selectionGameObjects.Count; i++)
                    {
                        selectionGameObjects[i] = EditorGUILayout.ObjectField("GameObject " + i.ToString() + ": ", selectionGameObjects[i], typeof(GameObject), true) as GameObject;
                    }
                }
                else
                {
                    EditorGUILayout.LabelField("Select a gameOject in the Hierarchy");
                    SelectedObject = null;
                }


                if (SelectedObject != null)
                {
                    //Check if there is a mesh filter else report it to the user and clear the selection!
                    if (SelectedObject.GetComponent <MeshFilter>() == true && SelectedObject.GetComponent <MeshFilter>() != null)
                    {
                        lastErrorLog = "";
                        if (didImport == false)
                        {
                            importSettingsFromSelectedGameObject();
                            OldSelectedObject = SelectedObject;
                            didImport         = true;
                        }
                        else if (OldSelectedObject != SelectedObject)
                        {
                            didImport = false;
                        }
                    }
                    else
                    {
                        //So there is no Mesh filter on this object!
                        //We can still use it we just got to use somthing else for volume... collider?
                        if (SelectedObject.GetComponent <Collider>() == true)
                        {
                            lastErrorLog = "Can't find MeshFilter, using collider!";
                            if (didImport == false)
                            {
                                importSettingsFromSelectedGameObject();
                                OldSelectedObject = SelectedObject;
                                didImport         = true;
                            }
                            else if (OldSelectedObject != SelectedObject)
                            {
                                didImport = false;
                            }
                        }
                        else
                        {
                            //Also no collider....
                            lastErrorLog = "There is no MeshFilter or Collider on this object!";
                        }
                    }



                    EditorGUILayout.Space();

                    if (ShowAdvancedInfo == true)
                    {
                        EditorGUILayout.LabelField("Gameobject settings:");
                        slicesPerAxis = EditorGUILayout.IntField("Slices Per Axis", slicesPerAxis);
                        if (slicesPerAxis < 1)
                        {
                            slicesPerAxis = 1;
                        }
                        else if (slicesPerAxis > 8)
                        {
                            slicesPerAxis = 8;
                        }
                        isConcave   = EditorGUILayout.Toggle("GameObject is concave", isConcave);                       // has its issues!
                        voxelsLimit = EditorGUILayout.IntField("Voxels limit", voxelsLimit);
                        if (slicesPerAxis < 1)
                        {
                            slicesPerAxis = 1;
                        }
                        else if (slicesPerAxis > 64)
                        {
                            slicesPerAxis = 64;
                        }
                    }
                    else
                    {
                        selectedFloatingQuality = (FloatingQuality)EditorGUILayout.EnumPopup("Floating Quality:", selectedFloatingQuality);
                        if (selectedFloatingQuality == FloatingQuality.ExtremeLow)
                        {
                            slicesPerAxis = 1;
                            voxelsLimit   = 2;
                        }
                        if (selectedFloatingQuality == FloatingQuality.Low)
                        {
                            slicesPerAxis = 2;
                            voxelsLimit   = 4;
                        }
                        if (selectedFloatingQuality == FloatingQuality.Medium)
                        {
                            slicesPerAxis = 4;
                            voxelsLimit   = 8;
                        }
                        if (selectedFloatingQuality == FloatingQuality.High)
                        {
                            slicesPerAxis = 6;
                            voxelsLimit   = 12;
                        }
                        if (selectedFloatingQuality == FloatingQuality.ExtremeHigh)
                        {
                            slicesPerAxis = 8;
                            voxelsLimit   = 16;
                        }
                    }

                    if (ShowAdvancedInfo == true)
                    {
                        SelectedMaterialType = (MaterialTypes)EditorGUILayout.EnumPopup("Material type:", SelectedMaterialType);
                    }
                    else
                    {
                        //Back to basic solids only!
                        SelectedMaterialType = MaterialTypes.Solid;
                    }
                    if (SelectedMaterialType == MaterialTypes.Solid)
                    {
                        selectedSolidsMaterial = (SolidsMaterialList)EditorGUILayout.EnumPopup("Solid Material:", selectedSolidsMaterial);
                    }
                    else if (SelectedMaterialType == MaterialTypes.Liquids)
                    {
                        selectedLiquidsMaterial = (LiquidsMaterialList)EditorGUILayout.EnumPopup("Liquid Material:", selectedLiquidsMaterial);
                    }
                    else
                    {
                        selectedGasesMaterial = (GasesMaterialList)EditorGUILayout.EnumPopup("Gas Material:", selectedGasesMaterial);
                    }


                    percentageSolid = EditorGUILayout.IntField("Percentage Solid:", percentageSolid);
                    if (percentageSolid < 0)
                    {
                        percentageSolid = 0;
                    }
                    else if (percentageSolid > 100)
                    {
                        percentageSolid = 100;
                    }
                    EditorGUILayout.Space();

                    if (GUILayout.Button("Calculate test results"))
                    {
                        calculateResults();                         //Update the results.
                    }

                    if (DidTest == true)
                    {
                        if (ShowAdvancedInfo)
                        {
                            testResultsString = "Test result of the object:" + System.Environment.NewLine + System.Environment.NewLine +
                                                "Calculated mass: " + CalculatedMass + System.Environment.NewLine +
                                                "Calculated volume: " + CalculatedVolume + System.Environment.NewLine +
                                                "Calculated density: " + CalculatedDensity + System.Environment.NewLine +
                                                "Float in water: " + ((CalculatedWillFloatInWater == true) ? "Yes" : "No").ToString() + System.Environment.NewLine +
                                                "Float in Air: " + ((CalculatedWillFloatInAir == true) ? "Yes" : "No").ToString();
                        }
                        else
                        {
                            //Will it float or not?!
                            testResultsString = "Test result of the object:" + System.Environment.NewLine + System.Environment.NewLine +
                                                "Float in water: " + ((CalculatedWillFloatInWater == true) ? "Yes" : "No").ToString() + System.Environment.NewLine +
                                                "Float in Air: " + ((CalculatedWillFloatInAir == true) ? "Yes" : "No").ToString();
                        }
                    }
                    else
                    {
                        testResultsString = "No test results yet!";
                    }

                    EditorGUILayout.HelpBox(testResultsString, MessageType.Info, true);

                    //Button
                    if (SelectedObject != null)
                    {
                        if (SelectedObject.GetComponent <RealisticBuoyancy>())
                        {
                            if (GUILayout.Button("Update gameobject script"))
                            {
                                if (selectionGameObjects != null && selectionGameObjects.Count > 0)
                                {
                                    foreach (var Selectedgameobject in selectionGameObjects)
                                    {
                                        createObjectScript(Selectedgameobject);
                                    }
                                }
                                else
                                {
                                    createObjectScript(SelectedObject);                                      // Update the script on the selected object.
                                }
                            }
                        }
                        else
                        {
                            if (GUILayout.Button("Create gameobject script"))
                            {
                                if (selectionGameObjects != null && selectionGameObjects.Count > 0)
                                {
                                    foreach (var Selectedgameobject in selectionGameObjects)
                                    {
                                        createObjectScript(Selectedgameobject);
                                    }
                                }
                                else
                                {
                                    createObjectScript(SelectedObject);                                      // Update the script on the selected object.
                                }
                            }
                        }
                    }
                    else                     //double check to make sure there is indeed a gamobject selected!
                    {
                        if (GUILayout.Button("First select a gameobject."))
                        {
                            //Still show the button but its does nothing :P
                        }
                    }
                }

                EditorGUILayout.Space();

                if (SelectedObject != null)
                {
                    if (ScriptSavedAfterTest == true)
                    {
                        stateInfo = "Changes have been saved!";
                    }
                    else
                    {
                        stateInfo = "Changes have NOT been saved!";
                    }
                    EditorGUILayout.HelpBox(stateInfo, MessageType.Info, true);
                }
            }
            EditorGUILayout.EndScrollView();

            EditorGUILayout.EndHorizontal();
        }
    }
Exemple #21
0
 public Jewellry(JewellryTypes jewellryType, string name, ItemTypes type, MaterialTypes material, int weight, List <Effect> effects)
     : base(name, type, material, weight, effects)
 {
     JewellryType = jewellryType;
 }
Exemple #22
0
 public Weapon(int damage, WeaponTypes weaponType, Handedness handed, DamageTypes damageType, string name, ItemTypes type, MaterialTypes material, int weight, List <Effect> effects)
     : base(name, type, material, weight, effects)
 {
     DamageAmount = damage;
     WeaponType   = weaponType;
     Handed       = handed;
     DamageType   = damageType;
 }