Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inventory with restrictions and item freezing and defrosting. Equipme…
…nt now delegates to base item, if any, for params. Fix bugs team recaching after recompile.
- Loading branch information
Showing
94 changed files
with
416 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
using System.Collections.Generic; | ||
|
||
[CustomEditor(typeof(Item))] | ||
public class ItemEditor : SRPGCKEditor { | ||
[MenuItem("SRPGCK/Create item", false, 3)] | ||
public static Item CreateItem() | ||
{ | ||
return ScriptableObjectUtility.CreateAsset<Item>( | ||
null, | ||
"Assets/SRPGCK Data/Items", | ||
true | ||
); | ||
} | ||
Item it; | ||
|
||
public override void OnEnable() { | ||
it = target as Item; | ||
base.OnEnable(); | ||
it.fdb = fdb; | ||
name = "Item"; | ||
} | ||
|
||
public override void OnSRPGCKInspectorGUI() { | ||
it.name = EditorGUILayout.TextField("Name", it.name); | ||
it.prefab = EditorGUILayout.ObjectField( | ||
"Prefab", | ||
it.prefab as UnityEngine.Object, | ||
typeof(Transform), | ||
false | ||
) as Transform; | ||
it.weight = EditorGUILayout.FloatField("Weight", it.weight); | ||
it.stackSize = EditorGUILayout.IntField("Stack Size", it.stackSize); | ||
it.parameters = EditorGUIExt.ParameterFoldout( | ||
"Parameter", | ||
it.parameters, | ||
"item."+it.itemName+".params.", | ||
formulaOptions, | ||
lastFocusedControl, | ||
ref it.editorShowParameters | ||
); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using UnityEngine; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using UnityEditor; | ||
|
||
public class InstantiatedItem : MonoBehaviour { | ||
public Item item; | ||
|
||
public bool HasParam(string pname) { | ||
return item.HasParam(pname); | ||
} | ||
|
||
public float GetParam( | ||
string pname, | ||
SkillDef scontext=null, | ||
float fallback=float.NaN | ||
) { | ||
return item.GetParam(pname, scontext, fallback); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.