浏览代码

[Shader Graph]Making it work on current setup.

/main
Tim Cooper 9 年前
当前提交
2de768fd
共有 17 个文件被更改,包括 429 次插入1151 次删除
  1. 4
      UnityProject/Assets/Editor/Material/AssetCallbacks/CreateShaderGraph.cs
  2. 4
      UnityProject/Assets/Editor/Material/AssetCallbacks/CreateShaderSubGraph.cs
  3. 4
      UnityProject/Assets/Editor/Material/Light/BaseLightFunction.cs
  4. 4
      UnityProject/Assets/Editor/Material/MaterialGraph.cs
  5. 25
      UnityProject/Assets/Editor/Material/Nodes/BaseMaterialNode.cs
  6. 24
      UnityProject/Assets/Editor/Material/Nodes/PixelShaderNode.cs
  7. 2
      UnityProject/Assets/Editor/Material/Nodes/SubGraphNode.cs
  8. 3
      UnityProject/Assets/Editor/Material/PixelGraph.cs
  9. 54
      UnityProject/Assets/Graphs/Fresnel.ShaderSubGraph
  10. 998
      UnityProject/Assets/Graphs/FresnelFromSGraph.ShaderGraph
  11. 4
      UnityProject/Assets/Graphs/FresnelFromSGraph.ShaderGraph.meta
  12. 2
      UnityProject/Assets/MaterialGraph/2DPreview.template
  13. 2
      UnityProject/Assets/MaterialGraph/shader.template
  14. 27
      UnityProject/ProjectSettings/GraphicsSettings.asset
  15. 399
      UnityProject/ProjectSettings/ProjectSettings.asset
  16. 16
      UnityProject/Assets/Editor/test.cs
  17. 8
      UnityProject/Assets/Editor/test.cs.meta

4
UnityProject/Assets/Editor/Material/AssetCallbacks/CreateShaderGraph.cs


namespace UnityEditor.Graphs.Material
{
public class CreateShaderGraph : EndNameEditActionCallback
/*public class CreateShaderGraph : EndNameEditActionCallback
{
[MenuItem("Assets/Create/Shader Graph", false, 208)]
public static void CreateMaterialGraph()

AssetDatabase.CreateAsset(graph, pathName);
graph.CreateSubAssets();
}
}
}*/
}

4
UnityProject/Assets/Editor/Material/AssetCallbacks/CreateShaderSubGraph.cs


namespace UnityEditor.Graphs.Material
{
public class CreateShaderSubGraph : EndNameEditActionCallback
/*public class CreateShaderSubGraph : EndNameEditActionCallback
{
[MenuItem("Assets/Create/Shader Sub-Graph", false, 209)]
public static void CreateMaterialSubGraph()

AssetDatabase.CreateAsset(graph, pathName);
graph.CreateSubAssets();
}
}
}*/
}

4
UnityProject/Assets/Editor/Material/Light/BaseLightFunction.cs


{
public override string GetName () { return "BlinnPhong"; }
}
class PBRMetalicLightFunction : BaseLightFunction
{
public override string GetName () { return "Standard"; }
}
}

4
UnityProject/Assets/Editor/Material/MaterialGraph.cs


public void UpdateShaderSource (string src, Dictionary<string, Texture> defaultTexutres)
{
UnityEditorInternal.InternalEditorUtility.UpdateShaderAsset (m_Shader, src);
UnityEditor.ShaderUtil.UpdateShaderAsset (m_Shader, src);
EditorMaterialUtility.SetShaderDefaults (m_Shader, defaultTexutres.Keys.ToArray (), defaultTexutres.Values.ToArray ());
}

"}" +
"}";
m_Shader = UnityEditorInternal.InternalEditorUtility.CreateShaderAsset(shaderSource);
m_Shader = UnityEditor.ShaderUtil.CreateShaderAsset(shaderSource);
m_Shader.name = name;
m_Shader.hideFlags = HideFlags.HideInHierarchy;
}

25
UnityProject/Assets/Editor/Material/Nodes/BaseMaterialNode.cs


return m_SlotDefaultValues.FirstOrDefault (x => x.slotName == slotName);
}
private static Shader m_DefaultPreviewShader;
private static Shader defaultPreviewShader
{
get
{
if (m_DefaultPreviewShader == null)
m_DefaultPreviewShader = Shader.Find("Diffuse");
return m_DefaultPreviewShader;
}
}
m_Material = new UnityEngine.Material(Shader.Find("Diffuse")) { hideFlags = HideFlags.DontSave };
m_Material = new UnityEngine.Material(defaultPreviewShader) { hideFlags = HideFlags.DontSave };
private PreviewMode m_GeneratedShaderMode = PreviewMode.Preview2D;
private bool needsUpdate

previewMaterial.SetVector("EDITOR_SIN_TIME",
new Vector4(
Mathf.Sin(time / 8.0f),
Mathf.Sin(time / 4.0f),
Mathf.Sin(time / 2.0f),
Mathf.Sin(time / 4.0f),
Mathf.Sin(time / 2.0f),
Mathf.Sin(time)));
}
}

MaterialWindow.DebugMaterialGraph (resultShader);
if (previewMaterial.shader.name != "Diffuse")
if (previewMaterial.shader != defaultPreviewShader)
previewMaterial.shader = UnityEditorInternal.InternalEditorUtility.CreateShaderAsset (resultShader);
previewMaterial.shader = UnityEditor.ShaderUtil.CreateShaderAsset (resultShader);
previewMaterial.shader.hideFlags = HideFlags.DontSave;
return true;
}

24
UnityProject/Assets/Editor/Material/Nodes/PixelShaderNode.cs


private const string kAlbedoSlotName = "Albedo";
private const string kNormalSlotName = "Normal";
private const string kEmissionSlotName = "Emission";
private const string kSpecularSlotName = "Specular";
private const string kGlossSlotName = "Gloss";
private const string kMetallicSlotName = "Metallic";
private const string kSmoothnessSlotName = "Smoothness";
private const string kOcclusion = "Occlusion";
private const string kAlphaSlotName = "Alpha";
[SerializeField]

AddSlot (new Slot(SlotType.InputSlot, kAlbedoSlotName));
AddSlot (new Slot(SlotType.InputSlot, kNormalSlotName));
AddSlot (new Slot(SlotType.InputSlot, kEmissionSlotName));
AddSlot (new Slot(SlotType.InputSlot, kSpecularSlotName));
AddSlot (new Slot(SlotType.InputSlot, kGlossSlotName));
AddSlot (new Slot(SlotType.InputSlot, kMetallicSlotName));
AddSlot (new Slot(SlotType.InputSlot, kSmoothnessSlotName));
AddSlot (new Slot(SlotType.InputSlot, kOcclusion));
AddSlot (new Slot(SlotType.InputSlot, kAlphaSlotName));
}

lightFuncIndex = GetLightFunctions ().IndexOf (lightFunction);
lightFuncIndex = EditorGUILayout.Popup (lightFuncIndex, s_LightFunctions.Select(x => x.GetName ()).ToArray (), EditorStyles.popup);
m_LightFunction = GetLightFunctions ()[lightFuncIndex].GetName ();
}
public bool IsSpecularConnected ()
{
var specSlot = FindInputSlot (kSpecularSlotName);
var glossSlot = FindInputSlot(kGlossSlotName);
if (specSlot == null || glossSlot == null)
return false;
if (specSlot.edges.Count > 0 || glossSlot.edges.Count > 0)
return true;
return false;
}
}
}

2
UnityProject/Assets/Editor/Material/Nodes/SubGraphNode.cs


outputString.AddShaderChunk(
"float4 "
+ GetOutputVariableNameForSlot(slot, generationMode)
+ " = float4(0);", false);
+ " = float4(0, 0, 0, 0);", false);
}
// Step 2...

3
UnityProject/Assets/Editor/Material/PixelGraph.cs


}
m_MasterNode.GenerateNodeCode(shaderBody, GenerationMode.SurfaceShader);
if (m_MasterNode.IsSpecularConnected())
shaderProperties.AddShaderProperty(new ColorPropertyChunk("_SpecColor", "Specular Color", Color.grey, false));
}
public void AddMasterNodeToAsset ()

54
UnityProject/Assets/Graphs/Fresnel.ShaderSubGraph


m_FromSlotName: Output
m_ToSlotName: Input1
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11400002}
m_ToNode: {fileID: 11400016}
m_FromSlotName: O01
m_ToSlotName: Input
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11400014}
m_ToNode: {fileID: 11400012}
m_FromSlotName: Output

m_FromSlotName: Normal
m_ToSlotName: Input2
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11400002}
m_ToNode: {fileID: 11400012}
m_FromSlotName: O00
m_ToSlotName: Input0
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11400012}
m_ToNode: {fileID: 11400004}
m_FromSlotName: Output

m_FromSlotName: Output
m_ToSlotName: Input
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11400002}
m_ToNode: {fileID: 11400012}
m_FromSlotName: O00
m_ToSlotName: Input0
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11400002}
m_ToNode: {fileID: 11400016}
m_FromSlotName: O01
m_ToSlotName: Input
color: {r: 1, g: 1, b: 1, a: 1}
m_InvalidEdges: []
m_InputsNode: {fileID: 11400002}
m_OutputsNode: {fileID: 11400004}

style: node
position:
serializedVersion: 2
x: 180
y: 240
x: 48
y: 228
- m_DefaultVector: {x: -1.13, y: 1, z: 1, w: 1}
- m_DefaultVector: {x: 1, y: 0.5, z: 1, w: 1}
- m_DefaultVector: {x: 3.50999999, y: 1, z: 1, w: 1}
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}
m_Editable: 1
m_SlotName: O01
m_Node: {fileID: 11400002}

style: node
position:
serializedVersion: 2
x: 180
y: -36
x: 204
y: 324
width: 84
height: 105
showEmptySlots: 1

style: node
position:
serializedVersion: 2
x: 180
y: 84
x: 204
y: 444
width: 74
height: 105
showEmptySlots: 1

style: node
position:
serializedVersion: 2
x: 372
y: 24
x: 396
y: 384
width: 74
height: 129
showEmptySlots: 1

style: node
position:
serializedVersion: 2
x: 720
x: 744
y: 300
width: 74
height: 129

style: node
position:
serializedVersion: 2
x: 288
y: 336
width: 118.867928
x: 144
y: 600
width: 213
height: 137
showEmptySlots: 1
m_SlotDefaultValues:

m_Node: {fileID: 11400016}
m_PrecisionNames:
- half
m_SwizzleChannel: 2
m_SwizzleChannel: 0
--- !u!114 &11400018
MonoBehaviour:
m_ObjectHideFlags: 1

style: node
position:
serializedVersion: 2
x: 432
y: 384
x: 420
y: 612
width: 74
height: 117
showEmptySlots: 1

998
UnityProject/Assets/Graphs/FresnelFromSGraph.ShaderGraph
文件差异内容过多而无法显示
查看文件

4
UnityProject/Assets/Graphs/FresnelFromSGraph.ShaderGraph.meta


fileFormatVersion: 2
guid: 764177c77373b424eaa9aa1a634a3cba
guid: 22fdc7dad83e95848868d4503582a5a1
assetBundleName:
assetBundleVariant:

2
UnityProject/Assets/MaterialGraph/2DPreview.template


v2f vert (appdata_full v)
{
v2f o;
v2f o = (v2f)0;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
${VertexShaderBody}
return o;

2
UnityProject/Assets/MaterialGraph/shader.template


${VertexShaderBody}
}
void surf (Input IN, inout SurfaceOutput o)
void surf (Input IN, inout SurfaceOutputStandard o)
{
${PixelShaderBody}
}

27
UnityProject/ProjectSettings/GraphicsSettings.asset


--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 4
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_LightmapStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDirSeparate: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepDynamicDirSeparate: 1
m_FogStripping: 0
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1

399
UnityProject/ProjectSettings/ProjectSettings.asset


--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
serializedVersion: 7
targetGlesGraphics: 1
targetResolution: 0
useOnDemandResources: 0
m_ShowUnitySplashScreen: 1
m_MobileRenderingPath: 1
m_UseDX11: 0
m_MobileMTRendering: 0
m_Stereoscopic3D: 0
iosAppInBackgroundBehavior: 0
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1

use24BitDepthBuffer: 0
disableDepthAndStencilBuffers: 0
defaultIsFullScreen: 0
defaultIsNativeResolution: 1
runInBackground: 0

enableHWStatistics: 1
submitAnalytics: 1
stripPhysics: 0
bakeCollisionMeshes: 0
xboxSkinOnGPU: 1
gpuSkinning: 0
xboxPIXTextureCapture: 0
visibleInBackground: 0
allowFullscreenSwitch: 1
d3d9FullscreenMode: 1
d3d11FullscreenMode: 1
wiiHio2Usage: -1
wiiLoadingScreenRectPlacement: 0
wiiLoadingScreenBackground: {r: 1, g: 1, b: 1, a: 1}
wiiLoadingScreenPeriod: 1000
wiiLoadingScreenFileName:
wiiLoadingScreenRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
xboxEnableGuest: 0
n3dsDisableStereoscopicView: 0
n3dsEnableSharedListOpt: 1
n3dsEnableVSync: 0
uiUse16BitDepthBuffer: 0
xboxOneResolution: 0
ps3SplashScreen: {fileID: 0}
videoMemoryForVertexBuffers: 0
psp2PowerMode: 0
psp2AcquireBGM: 1
wiiUTVResolution: 0
wiiUGamePadMSAA: 1
wiiUSupportsNunchuk: 0
wiiUSupportsClassicController: 0
wiiUSupportsBalanceBoard: 0
wiiUSupportsMotionPlus: 0
wiiUSupportsProController: 0
wiiUAllowScreenCapture: 1
wiiUControllerCount: 0
m_SupportedAspectRatios:
4:3: 1
5:4: 1

iPhoneBundleIdentifier: com.Company.ProductName
bundleIdentifier: com.Company.ProductName
bundleVersion: 1.0
preloadedAssets: []
metroEnableIndependentInputSource: 0
metroEnableLowLatencyPresentationAPI: 0
xboxOneDisableKinectGpuReservation: 0
virtualRealitySupported: 0
iPhoneBundleVersion: 1.0
AndroidMinSdkVersion: 6
AndroidMinSdkVersion: 9
stripEngineCode: 1
iPhoneBuildNumber: 0
preloadShaders: 0
VertexChannelCompressionMask:
serializedVersion: 2
m_Bits: 238
iPhoneTargetOSVersion: 10
iPhoneTargetOSVersion: 22
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0

iPhone47inSplashScreen: {fileID: 0}
iPhone55inPortraitSplashScreen: {fileID: 0}
iPhone55inLandscapeSplashScreen: {fileID: 0}
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
iOSLaunchScreenBackgroundColor:
serializedVersion: 2
rgba: 3452816845
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSDeviceRequirements: []
androidSplashScreen: {fileID: 0}
AndroidTVCompatibility: 1
AndroidIsGame: 1
androidEnableBanner: 1
m_AndroidBanners:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
- m_Icon: {fileID: 0}
m_Size: 128
- serializedVersion: 2
m_Icon: {fileID: 0}
m_Width: 128
m_Height: 128
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: WindowsStandaloneSupport
m_APIs: 01000000
m_Automatic: 0
- m_BuildTarget: AndroidPlayer
m_APIs: 08000000
m_Automatic: 0
wiiRegion: 1
wiiGameCode: RABA
wiiGameVersion:
wiiCompanyCode: ZZ
wiiSupportsNunchuk: 0
wiiSupportsClassicController: 0
wiiSupportsBalanceBoard: 0
wiiSupportsMotionPlus: 0
wiiControllerCount: 1
wiiFloatingPointExceptions: 0
wiiScreenCrashDumps: 1
wiiUTitleID: 0005000011000000
wiiUGroupID: 00010000
wiiUCommonSaveSize: 4096
wiiUAccountSaveSize: 2048
wiiUOlvAccessKey: 0
wiiUTinCode: 0
wiiUJoinGameId: 0
wiiUJoinGameModeMask: 0000000000000000
wiiUCommonBossSize: 0
wiiUAccountBossSize: 0
wiiUAddOnUniqueIDs: []
wiiUMainThreadStackSize: 3072
wiiULoaderThreadStackSize: 1024
wiiUSystemHeapSize: 128
wiiUTVStartupScreen: {fileID: 0}
wiiUGamePadStartupScreen: {fileID: 0}
wiiUProfilerLibPath:
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
locationUsageDescription:
XboxTitleId:
XboxImageXexPath:
XboxSpaPath:

ps3ThumbnailPath:
ps3BackgroundPath:
ps3SoundPath:
ps3NPAgeRating: 12
ps3TrophyCommId:
ps3NpCommunicationPassphrase:
ps3TrophyPackagePath:

ps3TrialMode: 0
flashStrippingLevel: 2
ps3VideoMemoryForAudio: 0
ps3EnableVerboseMemoryStats: 0
ps3UseSPUForUmbra: 0
ps3EnableMoveSupport: 1
ps3DisableDolbyEncoding: 0
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
ps4ParentalLevel: 1
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
ps4Category: 0
ps4MasterVersion: 01.00
ps4AppVersion: 01.00
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutResolution: 4
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
ps4StartupImagePath:
ps4SaveDataImagePath:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
ps4EnterButtonAssignment: 1
ps4ApplicationParam1: 0
ps4ApplicationParam2: 0
ps4ApplicationParam3: 0
ps4ApplicationParam4: 0
ps4DownloadDataSize: 0
ps4GarlicHeapSize: 2048
ps4Passcode: eaoEiIgxIX4a2dREbbSqWy6yhKIDCdJO
ps4pnSessions: 1
ps4pnPresence: 1
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4Audio3dVirtualSpeakerCount: 14
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4IncludedModules: []
monoEnv:
psp2Splashimage: {fileID: 0}
psp2NPTrophyPackPath:
psp2NPSupportGBMorGJP: 0
psp2NPAgeRating: 12
psp2NPTitleDatPath:
psp2NPCommsID:
psp2NPCommunicationsID:
psp2NPCommsPassphrase:
psp2NPCommsSig:
psp2ParamSfxPath:
psp2ManualPath:
psp2LiveAreaGatePath:
psp2LiveAreaBackroundPath:
psp2LiveAreaPath:
psp2LiveAreaTrialPath:
psp2PatchChangeInfoPath:
psp2PatchOriginalPackage:
psp2PackagePassword: yapnxrpMCARCr4zdGc81tBDKsMlaZTXC
psp2KeystoneFile:
psp2MemoryExpansionMode: 0
psp2DRMType: 0
psp2StorageType: 0
psp2MediaCapacity: 0
psp2DLCConfigPath:
psp2ThumbnailPath:
psp2BackgroundPath:
psp2SoundPath:
psp2TrophyCommId:
psp2TrophyPackagePath:
psp2PackagedResourcesPath:
psp2SaveDataQuota: 10240
psp2ParentalLevel: 1
psp2ShortTitle: Not Set
psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF
psp2Category: 0
psp2MasterVersion: 01.00
psp2AppVersion: 01.00
psp2TVBootMode: 0
psp2EnterButtonAssignment: 2
psp2TVDisableEmu: 0
psp2AllowTwitterDialog: 1
psp2Upgradable: 0
psp2HealthWarning: 0
psp2UseLibLocation: 0
psp2InfoBarOnStartup: 0
psp2InfoBarColor: 0
psmSplashimage: {fileID: 0}
spritePackerPolicy:
metroPackageLogo140:
metroPackageLogo180:
metroPackageLogo240:
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:

metroApplicationDescription:
metroTileLogo:
metroTileWideLogo:
metroTileSmallLogo:
metroStoreTileLogo80:
metroStoreTileLogo:
metroStoreTileLogo140:
metroStoreTileLogo180:
metroStoreTileWideLogo80:
metroStoreTileWideLogo:
metroStoreTileWideLogo140:
metroStoreTileWideLogo180:
metroStoreTileSmallLogo80:
metroStoreTileSmallLogo:
metroStoreTileSmallLogo140:
metroStoreTileSmallLogo180:
metroStoreSmallTile80:
metroStoreSmallTile:
metroStoreSmallTile140:
metroStoreSmallTile180:
metroStoreLargeTile80:
metroStoreLargeTile:
metroStoreLargeTile140:
metroStoreLargeTile180:
metroStoreSplashScreenImage:
metroStoreSplashScreenImage140:
metroStoreSplashScreenImage180:
metroPhoneAppIcon:
metroPhoneAppIcon140:
metroPhoneAppIcon240:
metroPhoneSmallTile:
metroPhoneSmallTile140:
metroPhoneSmallTile240:
metroPhoneMediumTile:
metroPhoneMediumTile140:
metroPhoneMediumTile240:
metroPhoneWideTile:
metroPhoneWideTile140:
metroPhoneWideTile240:
metroPhoneSplashScreenImage:
metroPhoneSplashScreenImage140:
metroPhoneSplashScreenImage240:
metroMediumTileShowName: 0
metroLargeTileShowName: 0
metroWideTileShowName: 0
metroDefaultTileSize: 1
metroSplashScreenImage:
metroCapabilities: {}
platformCapabilities: {}
metroFTAName:
metroFTAFileTypes: []
metroProtocolName:
bb10DeviceAddress:
bb10DevicePassword:
bb10TokenPath:
bb10TokenExires:
bb10TokenAuthor:
bb10TokenAuthorId:
bb10AuthorId:
bb10CskPassword:
bb10SaveLogPath:
bb10AuthorIdOveride: 0
bb10SharedPermissions: 0
bb10CameraPermissions: 0
bb10GPSPermissions: 0
bb10DeviceIDPermissions: 0
bb10MicrophonePermissions: 0
bb10BuildId: 0
bb10LandscapeSplashScreen: {fileID: 0}
bb10PortraitSplashScreen: {fileID: 0}
bb10SquareSplashScreen: {fileID: 0}
firstStreamedLevelWithResources: 0
unityRebuildLibraryVersion: 9
unityForwardCompatibleVersion: 38
unityStandardAssetsVersion: 0
blackberryDeviceAddress:
blackberryDevicePassword:
blackberryTokenPath:
blackberryTokenExires:
blackberryTokenAuthor:
blackberryTokenAuthorId:
blackberryCskPassword:
blackberrySaveLogPath:
blackberrySharedPermissions: 0
blackberryCameraPermissions: 0
blackberryGPSPermissions: 0
blackberryDeviceIDPermissions: 0
blackberryMicrophonePermissions: 0
blackberryGamepadSupport: 0
blackberryBuildId: 0
blackberryLandscapeSplashScreen: {fileID: 0}
blackberryPortraitSplashScreen: {fileID: 0}
blackberrySquareSplashScreen: {fileID: 0}
tizenProductDescription:
tizenProductURL:
tizenSigningProfileName:
tizenGPSPermissions: 0
tizenMicrophonePermissions: 0
n3dsUseExtSaveData: 0
n3dsCompressStaticMem: 1
n3dsExtSaveDataNumber: 0x12345
n3dsStackSize: 131072
n3dsTargetPlatform: 2
n3dsRegion: 7
n3dsMediaSize: 0
n3dsLogoStyle: 3
n3dsTitle: GameName
n3dsProductCode:
n3dsApplicationId: 0xFF3FF
stvDeviceAddress:
stvProductDescription:
stvProductAuthor:
stvProductAuthorEmail:
stvProductLink:
stvProductCategory: 0
XboxOneProductId:
XboxOneUpdateKey:
XboxOneSandboxId:
XboxOneContentId:
XboxOneTitleId:
XboxOneSCId:
XboxOneGameOsOverridePath:
XboxOnePackagingOverridePath:
XboxOneAppManifestOverridePath:
XboxOnePackageEncryption: 0
XboxOnePackageUpdateGranularity: 2
XboxOneDescription:
XboxOneIsContentPackage: 0
XboxOneEnableGPUVariability: 0
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
intPropertyNames:
- Android::ScriptingBackend
- Standalone::ScriptingBackend
Android::ScriptingBackend: 0
Standalone::ScriptingBackend: 0
boolPropertyNames: []
stringPropertyNames: []
cloudProjectId:
projectName:
organizationId:
cloudEnabled: 0

16
UnityProject/Assets/Editor/test.cs


using UnityEngine;
using UnityEditor;
using System.Collections;
public class test : Editor {
[MenuItem("CONTEXT/MeshRenderer/CreateInstance")]
// Use this for initialization
static void Start (MenuCommand context) {
var renderer = context.context as Renderer;
renderer.sharedMaterial = Instantiate (renderer.sharedMaterial) as Material;
}
}

8
UnityProject/Assets/Editor/test.cs.meta


fileFormatVersion: 2
guid: 825c4149778b4114d8246a73c2618d54
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
正在加载...
取消
保存