예제 #1
0
        public static Vector3 DrawUnitDefensiveSetting(Unit unit, float startX, float startY, List <GameObject> objHList, string[] objHLabelList)
        {
            //float cachedX=startX;
            //float cachedY=startY;

            string[] armorTypeLabel = EditorDBManager.GetArmorTypeLabel();
            cont = new GUIContent("Armor Type:", "The armor type of the unit\nArmor type can be configured in Damage Armor Table Editor");
            EditorGUI.LabelField(new Rect(startX, startY += spaceY, width, height), cont);
            unit.armorType = EditorGUI.Popup(new Rect(startX + spaceX, startY, width, height), unit.armorType, armorTypeLabel);

            int objID = GetObjectIDFromHList(unit.targetPoint, objHList);

            cont = new GUIContent("TargetPoint:", "The transform object which indicate the center point of the unit\nThis would be the point where the shootObject and effect will be aiming at");
            EditorGUI.LabelField(new Rect(startX, startY += spaceY, width, height), cont);
            objID            = EditorGUI.Popup(new Rect(startX + spaceX, startY, width, height), objID, objHLabelList);
            unit.targetPoint = (objHList[objID] == null) ? null : objHList[objID].transform;

            cont = new GUIContent("Hit Threshold:", "The range from the targetPoint where a shootObject is considered reached the target");
            EditorGUI.LabelField(new Rect(startX, startY += spaceY, width, height), cont);
            unit.hitThreshold = EditorGUI.FloatField(new Rect(startX + spaceX, startY, 40, height), unit.hitThreshold);

            cont = new GUIContent("Immuned to Crit:", "Check if the unit is immuned to critical hit");
            EditorGUI.LabelField(new Rect(startX, startY += spaceY, width, height), cont);
            unit.immuneToCrit = EditorGUI.Toggle(new Rect(startX + spaceX, startY, 40, height), unit.immuneToCrit);

            cont = new GUIContent("Immuned to Slow:", "Check if the unit is immuned to slow");
            EditorGUI.LabelField(new Rect(startX, startY += spaceY, width, height), cont);
            unit.immuneToSlow = EditorGUI.Toggle(new Rect(startX + spaceX, startY, 40, height), unit.immuneToSlow);

            cont = new GUIContent("Immuned to Stun:", "Check if the unit is immuned to stun");
            EditorGUI.LabelField(new Rect(startX, startY += spaceY, width, height), cont);
            unit.immuneToStun = EditorGUI.Toggle(new Rect(startX + spaceX, startY, 40, height), unit.immuneToStun);

            return(new Vector3(startX, startY, spaceX + width));
        }