add
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef3665df0e0c64945b678015ab2fe7dd
|
||||
folderAsset: yes
|
||||
timeCreated: 1484616170
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(HUDText))]
|
||||
public class HUDTextInspector:Editor {
|
||||
HUDText hud;
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
serializedObject.Update ();
|
||||
hud = target as HUDText;
|
||||
EditorGUILayout.BeginHorizontal ();{
|
||||
if (NGUIEditorTools.DrawPrefixButton ("Font", GUILayout.Width (64f))) {
|
||||
ComponentSelector.Show<UIFont> (OnNGUIFont);
|
||||
}
|
||||
NGUIEditorTools.DrawProperty ("Font Name", serializedObject, "fontName"); // add by chenbin
|
||||
}
|
||||
EditorGUILayout.EndHorizontal ();
|
||||
base.OnInspectorGUI ();
|
||||
|
||||
}
|
||||
|
||||
void OnNGUIFont (Object obj)
|
||||
{
|
||||
serializedObject.Update();
|
||||
SerializedProperty sp = serializedObject.FindProperty("font");
|
||||
sp.objectReferenceValue = obj;
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
hud.fontName = obj.name;
|
||||
NGUISettings.ambigiousFont = obj;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2327528ec4af846689b78cc1f1d5b5dd
|
||||
timeCreated: 1450423026
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a01ac1dd4f4524dbf9cb7c734b4a0a00
|
||||
folderAsset: yes
|
||||
timeCreated: 1484616170
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d2d4759c092d4d09a7141217deb97de
|
||||
folderAsset: yes
|
||||
timeCreated: 1484616172
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,845 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 1
|
||||
m_BakeResolution: 50
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 0
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 1024
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &5
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666666
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &221548598
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 221548599}
|
||||
- component: {fileID: 221548600}
|
||||
m_Layer: 8
|
||||
m_Name: Anchor
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &221548599
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 221548598}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 983564816}
|
||||
m_Father: {fileID: 1107741247}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &221548600
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 221548598}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c8077b76001d36d489868d20d28bddb9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
uiCamera: {fileID: 1107741248}
|
||||
container: {fileID: 0}
|
||||
side: 8
|
||||
runOnlyOnce: 0
|
||||
relativeOffset: {x: 0, y: 0}
|
||||
pixelOffset: {x: 0, y: 0}
|
||||
widgetContainer: {fileID: 0}
|
||||
--- !u!1 &541631162
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 541631167}
|
||||
- component: {fileID: 541631166}
|
||||
- component: {fileID: 541631164}
|
||||
- component: {fileID: 541631163}
|
||||
- component: {fileID: 541631168}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &541631163
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 541631162}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &541631164
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 541631162}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &541631166
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 541631162}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 100
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967263
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &541631167
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 541631162}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &541631168
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 541631162}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a92b5d748695fd44aac9feef17ba415, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
eventType: 1
|
||||
eventsGoToColliders: 0
|
||||
eventReceiverMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
debug: 0
|
||||
useMouse: 1
|
||||
useTouch: 1
|
||||
allowMultiTouch: 1
|
||||
useKeyboard: 1
|
||||
useController: 1
|
||||
stickyTooltip: 1
|
||||
tooltipDelay: 1
|
||||
longPressTooltip: 0
|
||||
mouseDragThreshold: 4
|
||||
mouseClickThreshold: 10
|
||||
touchDragThreshold: 40
|
||||
touchClickThreshold: 40
|
||||
rangeDistance: -1
|
||||
scrollAxisName: Mouse ScrollWheel
|
||||
verticalAxisName: Vertical
|
||||
horizontalAxisName: Horizontal
|
||||
commandClick: 1
|
||||
submitKey0: 13
|
||||
submitKey1: 330
|
||||
cancelKey0: 27
|
||||
cancelKey1: 331
|
||||
--- !u!1 &819175772
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 819175776}
|
||||
- component: {fileID: 819175775}
|
||||
- component: {fileID: 819175773}
|
||||
m_Layer: 0
|
||||
m_Name: body
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &819175773
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 819175772}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &819175775
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 819175772}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &819175776
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 819175772}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1025894251}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &983564815
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 983564816}
|
||||
- component: {fileID: 983564817}
|
||||
- component: {fileID: 983564818}
|
||||
- component: {fileID: 983564819}
|
||||
m_Layer: 8
|
||||
m_Name: HUDRoot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &983564816
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 983564815}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 221548599}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &983564817
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 983564815}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ae942c9068183dc40a9d01f648273726, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
leftAnchor:
|
||||
target: {fileID: 0}
|
||||
relative: 0
|
||||
absolute: 0
|
||||
rightAnchor:
|
||||
target: {fileID: 0}
|
||||
relative: 1
|
||||
absolute: 0
|
||||
bottomAnchor:
|
||||
target: {fileID: 0}
|
||||
relative: 0
|
||||
absolute: 0
|
||||
topAnchor:
|
||||
target: {fileID: 0}
|
||||
relative: 1
|
||||
absolute: 0
|
||||
updateAnchors: 1
|
||||
showInPanelTool: 1
|
||||
generateNormals: 0
|
||||
widgetsAreStatic: 0
|
||||
cullWhileDragging: 0
|
||||
alwaysOnScreen: 0
|
||||
anchorOffset: 0
|
||||
softBorderPadding: 1
|
||||
renderQueue: 0
|
||||
startingRenderQueue: 3000
|
||||
mClipTexture: {fileID: 0}
|
||||
mAlpha: 1
|
||||
mClipping: 0
|
||||
mClipRange: {x: 0, y: 0, z: 0, w: 0}
|
||||
mClipSoftness: {x: 40, y: 40}
|
||||
mDepth: 0
|
||||
mSortingOrder: 0
|
||||
mClipOffset: {x: 0, y: 0}
|
||||
--- !u!114 &983564818
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 983564815}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d4e5389dad3931049b99d0d749bba30f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!54 &983564819
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 983564815}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 1
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!1 &1004477205
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1004477206}
|
||||
m_Layer: 0
|
||||
m_Name: hudAnchor
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1004477206
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1004477205}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1025894251}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1025894250
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1025894251}
|
||||
- component: {fileID: 1025894252}
|
||||
- component: {fileID: 1025894253}
|
||||
m_Layer: 0
|
||||
m_Name: player
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1025894251
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1025894250}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 819175776}
|
||||
- {fileID: 1004477206}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1025894252
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1025894250}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 551340f79aac243a88edd74355725dfa, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
hudAnchor: {fileID: 1004477206}
|
||||
mGameCamera: {fileID: 541631166}
|
||||
mUICamera: {fileID: 1107741248}
|
||||
prefHudtxt: {fileID: 11400002, guid: fe9b7a9f0478541e888e595188c812b0, type: 3}
|
||||
--- !u!65 &1025894253
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1025894250}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1107741246
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1107741247}
|
||||
- component: {fileID: 1107741248}
|
||||
- component: {fileID: 1107741249}
|
||||
m_Layer: 8
|
||||
m_Name: Camera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1107741247
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1107741246}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 221548599}
|
||||
m_Father: {fileID: 1851781525}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!20 &1107741248
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1107741246}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 3
|
||||
m_BackGroundColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: -2
|
||||
far clip plane: 2
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 1
|
||||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 256
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!114 &1107741249
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1107741246}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a92b5d748695fd44aac9feef17ba415, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
eventType: 1
|
||||
eventsGoToColliders: 0
|
||||
eventReceiverMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 256
|
||||
debug: 0
|
||||
useMouse: 1
|
||||
useTouch: 1
|
||||
allowMultiTouch: 1
|
||||
useKeyboard: 1
|
||||
useController: 1
|
||||
stickyTooltip: 1
|
||||
tooltipDelay: 1
|
||||
longPressTooltip: 0
|
||||
mouseDragThreshold: 4
|
||||
mouseClickThreshold: 10
|
||||
touchDragThreshold: 40
|
||||
touchClickThreshold: 40
|
||||
rangeDistance: -1
|
||||
scrollAxisName: Mouse ScrollWheel
|
||||
verticalAxisName: Vertical
|
||||
horizontalAxisName: Horizontal
|
||||
commandClick: 1
|
||||
submitKey0: 13
|
||||
submitKey1: 330
|
||||
cancelKey0: 27
|
||||
cancelKey1: 331
|
||||
--- !u!1 &1792807755
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1792807757}
|
||||
- component: {fileID: 1792807756}
|
||||
m_Layer: 0
|
||||
m_Name: Directional light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1792807756
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1792807755}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.802082
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 0
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 1
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1792807757
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1792807755}
|
||||
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
|
||||
m_LocalPosition: {x: 0.33333337, y: 0, z: -0.02866667}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1851781523
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1851781525}
|
||||
- component: {fileID: 1851781524}
|
||||
m_Layer: 8
|
||||
m_Name: UI Root (2D)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1851781524
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1851781523}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2c5ecb5660b11414fb042fb826e03b73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
scalingStyle: 0
|
||||
manualWidth: 1280
|
||||
manualHeight: 720
|
||||
minimumHeight: 320
|
||||
maximumHeight: 1536
|
||||
fitWidth: 0
|
||||
fitHeight: 1
|
||||
adjustByDPI: 0
|
||||
shrinkPortraitUI: 0
|
||||
--- !u!4 &1851781525
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1851781523}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -1000, z: 0}
|
||||
m_LocalScale: {x: 0.004166667, y: 0.004166667, z: 0.004166667}
|
||||
m_Children:
|
||||
- {fileID: 1107741247}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dde36f0f2dab14d3dba0981a4fed870d
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c08fd5462c274eb3bc4b317790d6de9
|
||||
folderAsset: yes
|
||||
timeCreated: 1484616171
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
//--------------------------------------------
|
||||
// NGUI: HUD Text
|
||||
// Copyright © 2012 Tasharen Entertainment
|
||||
//--------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("NGUI/Examples/HUD Root")]
|
||||
public class HUDRoot : MonoBehaviour
|
||||
{
|
||||
static public GameObject go;
|
||||
void Awake () { go = gameObject; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d4e5389dad3931049b99d0d749bba30f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class HUDTest : UIEventListener {
|
||||
|
||||
public Transform hudAnchor;
|
||||
public Camera mGameCamera;
|
||||
public Camera mUICamera;
|
||||
public HUDText prefHudtxt;
|
||||
|
||||
HUDText hudtxt;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
if(hudtxt == null) {
|
||||
hudtxt = Object.Instantiate(prefHudtxt) as HUDText;
|
||||
hudtxt.transform.parent = HUDRoot.go.transform;
|
||||
hudtxt.transform.localScale = Vector3.one;
|
||||
hudtxt.transform.localPosition = Vector3.zero;
|
||||
UIFollowTarget ft = hudtxt.gameObject.AddComponent<UIFollowTarget>();
|
||||
ft.target = hudAnchor;
|
||||
ft.setCamera(mGameCamera, mUICamera);
|
||||
hudtxt.Add("Please click the cube...", Color.white, -1); //最后一个参数:-1 表示常驻
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OnClick() {
|
||||
if(hudtxt == null) {
|
||||
Start ();
|
||||
}
|
||||
hudtxt.Add(1, Color.red, 1);
|
||||
}
|
||||
|
||||
void OnDrag(Vector2 delta) {
|
||||
Vector3 off = new Vector3(delta.x, delta.y, 0);
|
||||
transform.localPosition += (off*0.01f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 551340f79aac243a88edd74355725dfa
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61d44dfffdc394cbca32a0c552ba20ca
|
||||
folderAsset: yes
|
||||
timeCreated: 1484616171
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe9b7a9f0478541e888e595188c812b0
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 282bf342305824ff2a533b707870a3af
|
||||
folderAsset: yes
|
||||
timeCreated: 1484616171
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
351
Assets/CoolapeFrame/3rd/NGUI_Enhance/HUD Text/Scripts/HUDText.cs
Normal file
351
Assets/CoolapeFrame/3rd/NGUI_Enhance/HUD Text/Scripts/HUDText.cs
Normal file
@@ -0,0 +1,351 @@
|
||||
//--------------------------------------------
|
||||
// NGUI: HUD Text
|
||||
// Copyright © 2012 Tasharen Entertainment
|
||||
//--------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// HUD text creates temporary on-screen text entries that are perfect for damage, effects, and messages.
|
||||
/// </summary>
|
||||
|
||||
[AddComponentMenu("NGUI/Examples/HUD Text")]
|
||||
public class HUDText : MonoBehaviour
|
||||
{
|
||||
protected class Entry
|
||||
{
|
||||
public float time; // Timestamp of when this entry was added
|
||||
public float stay = 0f; // How long the text will appear to stay stationary on the screen
|
||||
public float offset = 0f; // How far the object has moved based on time
|
||||
public float val = 0f; // Optional value (used for damage)
|
||||
public UILabel label; // Label on the game object
|
||||
public float scaleTime = 0; // add by chenbin
|
||||
|
||||
public float movementStart { get { return time + stay; } }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sorting comparison function.
|
||||
/// </summary>
|
||||
|
||||
static int Comparison(Entry a, Entry b)
|
||||
{
|
||||
if (a.movementStart < b.movementStart) return -1;
|
||||
if (a.movementStart > b.movementStart) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Font that will be used to create labels.
|
||||
/// </summary>
|
||||
[HideInInspector]
|
||||
public string fontName; //add by chenbin
|
||||
[HideInInspector]
|
||||
public UIFont font;
|
||||
|
||||
/// <summary>
|
||||
/// Effect applied to the text.
|
||||
/// </summary>
|
||||
|
||||
public UILabel.Effect effect = UILabel.Effect.None;
|
||||
|
||||
public bool inactiveWhenFinish = false;
|
||||
public bool gradient = false;
|
||||
public FontStyle fontStyle = FontStyle.Normal;
|
||||
public int spacingX = 0;
|
||||
public bool needAddValue = true;
|
||||
public bool needQueue = true;
|
||||
public float scaleOffset = 1;
|
||||
public float speed = 1;
|
||||
public float hightOffset = 0;
|
||||
|
||||
public AnimationCurve scaleCurve = new AnimationCurve(new Keyframe[] { new Keyframe(0f, 0f), new Keyframe(1f, 1f) });
|
||||
|
||||
/// <summary>
|
||||
/// Curve used to move entries with time.
|
||||
/// </summary>
|
||||
|
||||
public AnimationCurve offsetCurve = new AnimationCurve(new Keyframe[] { new Keyframe(0f, 0f), new Keyframe(3f, 40f) });
|
||||
|
||||
/// <summary>
|
||||
/// Curve used to fade out entries with time.
|
||||
/// </summary>
|
||||
|
||||
public AnimationCurve alphaCurve = new AnimationCurve(new Keyframe[] { new Keyframe(1f, 1f), new Keyframe(3f, 0.001f) });
|
||||
|
||||
List<Entry> mList = new List<Entry>();
|
||||
List<Entry> mUnused = new List<Entry>();
|
||||
|
||||
int counter = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Whether some HUD text is visible.
|
||||
/// </summary>
|
||||
|
||||
public bool isVisible { get { return mList.Count != 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Create a new entry, reusing an old entry if necessary.
|
||||
/// </summary>
|
||||
|
||||
Entry Create()
|
||||
{
|
||||
// See if an unused entry can be reused
|
||||
if (mUnused.Count > 0)
|
||||
{
|
||||
Entry ent = mUnused[mUnused.Count - 1];
|
||||
mUnused.RemoveAt(mUnused.Count - 1);
|
||||
ent.time = Time.realtimeSinceStartup;
|
||||
ent.label.depth = NGUITools.CalculateNextDepth(HUDRoot.go) + 10;
|
||||
//ent.label.gameObject.active = true;
|
||||
ent.offset = 0f;
|
||||
ent.scaleTime = 0f;
|
||||
ent.label.applyGradient = gradient;
|
||||
ent.label.enabled = false;
|
||||
ent.label.gameObject.SetActive(true);
|
||||
mList.Add(ent);
|
||||
return ent;
|
||||
}
|
||||
|
||||
// New entry
|
||||
Entry ne = new Entry();
|
||||
ne.time = Time.realtimeSinceStartup;
|
||||
ne.label = NGUITools.AddWidget<UILabel>(gameObject);
|
||||
ne.label.name = counter.ToString();
|
||||
ne.label.effectStyle = effect;
|
||||
ne.label.applyGradient = gradient;
|
||||
ne.label.fontStyle = fontStyle;
|
||||
ne.label.spacingX = spacingX;
|
||||
ne.label.bitmapFont = font;
|
||||
if (font != null)
|
||||
{
|
||||
ne.label.fontSize = font.defaultSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
ne.label.fontSize = 30;
|
||||
}
|
||||
|
||||
// Make it small so that it's invisible to start with
|
||||
ne.label.cachedTransform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
|
||||
ne.label.overflowMethod = UILabel.Overflow.ResizeHeight;
|
||||
ne.label.width = (int)(Screen.width * UIRoot.GetPixelSizeAdjustment(ne.label.gameObject) * 0.65f);
|
||||
ne.scaleTime = 0f;
|
||||
mList.Add(ne);
|
||||
++counter;
|
||||
return ne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete the specified entry, adding it to the unused list.
|
||||
/// </summary>
|
||||
|
||||
void Delete(Entry ent)
|
||||
{
|
||||
ent.label.enabled = false;
|
||||
if (inactiveWhenFinish)
|
||||
{
|
||||
ent.label.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ent.label.transform.localPosition = new Vector3(0, 10000, 0);
|
||||
}
|
||||
mList.Remove(ent);
|
||||
mUnused.Add(ent);
|
||||
}
|
||||
|
||||
public void init(int num = 1)
|
||||
{
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
Entry ne = Create();
|
||||
mList.Add(ne);
|
||||
}
|
||||
int count = mList.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
mUnused.Add(mList[i]);
|
||||
}
|
||||
mList.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a new scrolling text entry.
|
||||
/// </summary>
|
||||
public UILabel Add(object obj, Color c, float stayDuration, float scaleOffset = 1)
|
||||
{
|
||||
if (!enabled) return null;
|
||||
|
||||
float time = Time.realtimeSinceStartup;
|
||||
bool isNumeric = false;
|
||||
float val = 0f;
|
||||
this.scaleOffset = scaleOffset;
|
||||
|
||||
if (obj is float)
|
||||
{
|
||||
isNumeric = true;
|
||||
val = (float)obj;
|
||||
}
|
||||
else if (obj is int)
|
||||
{
|
||||
isNumeric = true;
|
||||
val = (int)obj;
|
||||
}
|
||||
else if (obj is double)
|
||||
{
|
||||
isNumeric = true;
|
||||
val = float.Parse(obj.ToString());
|
||||
} else if (obj is System.Int64)
|
||||
{
|
||||
isNumeric = true;
|
||||
val = float.Parse(obj.ToString());
|
||||
}
|
||||
if (isNumeric && needAddValue)
|
||||
{
|
||||
if (Mathf.Abs(val) <= 0.0001f) return null;
|
||||
for (int i = mList.Count; i > 0;)
|
||||
{
|
||||
Entry ent = mList[--i];
|
||||
if (ent.time + 1f < time) continue;
|
||||
if (ent.val < 0f && val < 0f)
|
||||
{
|
||||
ent.val += val;
|
||||
ent.label.text = Mathf.RoundToInt(ent.val).ToString();
|
||||
ent.label.fontSize = Mathf.CeilToInt(font.defaultSize * scaleOffset);
|
||||
return ent.label;
|
||||
}
|
||||
else if (ent.val > 0f && val > 0f)
|
||||
{
|
||||
ent.val += val;
|
||||
ent.label.text = Coolape.PStr.begin().a ("+").a (Mathf.RoundToInt(ent.val)).end(); // add by chenbin
|
||||
//ent.label.text = Mathf.RoundToInt(ent.val).ToString();
|
||||
ent.label.fontSize = Mathf.CeilToInt(font.defaultSize * scaleOffset);
|
||||
return ent.label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create a new entry
|
||||
Entry ne = Create();
|
||||
ne.stay = stayDuration;
|
||||
ne.label.color = c;
|
||||
if (font != null)
|
||||
{
|
||||
ne.label.fontSize = Mathf.CeilToInt(font.defaultSize * scaleOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
ne.label.fontSize = 30;
|
||||
}
|
||||
ne.val = val;
|
||||
|
||||
if (isNumeric)
|
||||
{
|
||||
ne.label.text = (val < 0f ? Mathf.RoundToInt(ne.val).ToString() : Coolape.PStr.begin().a("+").a(Mathf.RoundToInt(ne.val)).e());
|
||||
}
|
||||
else
|
||||
{
|
||||
ne.label.text = obj.ToString();
|
||||
}
|
||||
ne.scaleTime = ne.scaleTime >= 1 ? 0 : ne.scaleTime; //add by chenbin
|
||||
|
||||
// Sort the list
|
||||
mList.Sort(Comparison);
|
||||
return ne.label;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disable all labels when this script gets disabled.
|
||||
/// </summary>
|
||||
void OnDisable()
|
||||
{
|
||||
Entry lent = null;
|
||||
int count = mList.Count;
|
||||
for (int i = count - 1; i >= 0; i--)
|
||||
{
|
||||
lent = mList[i];
|
||||
if (lent.label != null)
|
||||
{
|
||||
Delete(lent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the position of all labels, as well as update their size and alpha.
|
||||
/// </summary>
|
||||
|
||||
float time = 0;
|
||||
Keyframe[] offsets;
|
||||
Keyframe[] alphas;
|
||||
float alphaEnd;
|
||||
float offsetEnd;
|
||||
float totalEnd;
|
||||
Entry cellEnt;
|
||||
float currentTime;
|
||||
float offset = 0f;
|
||||
float tmpSize;
|
||||
|
||||
// [HideInInspector]
|
||||
public bool ignoreTimeScale = true;
|
||||
|
||||
void Update()
|
||||
{
|
||||
time = Time.realtimeSinceStartup;
|
||||
|
||||
offsets = offsetCurve.keys;
|
||||
alphas = alphaCurve.keys;
|
||||
|
||||
offsetEnd = offsets[offsets.Length - 1].time;
|
||||
alphaEnd = alphas[alphas.Length - 1].time;
|
||||
totalEnd = Mathf.Max(offsetEnd, alphaEnd);
|
||||
|
||||
// Adjust alpha and delete old entries
|
||||
for (int i = mList.Count; i > 0;)
|
||||
{
|
||||
cellEnt = mList[--i];
|
||||
if (cellEnt.stay < 0)
|
||||
{
|
||||
//NGUI 2.X
|
||||
// ent.label.cachedTransform.localScale = new Vector3(font.size, font.size, 1f); //modify by chenbin
|
||||
//NGUI 3.0
|
||||
cellEnt.label.cachedTransform.localScale = Vector3.one; // add by chenbin
|
||||
|
||||
cellEnt.label.enabled = true;
|
||||
continue;
|
||||
}
|
||||
currentTime = time - cellEnt.movementStart;
|
||||
cellEnt.offset = offsetCurve.Evaluate(currentTime);
|
||||
cellEnt.label.alpha = alphaCurve.Evaluate(currentTime);
|
||||
|
||||
// Fade the label in by adjusting its size
|
||||
// float size = font.size * Mathf.Clamp01((time - ent.time) * 4f); // del by chenbin
|
||||
// float size = Mathf.Clamp01((time - ent.time) * 4f); //add by chenbin
|
||||
cellEnt.scaleTime += (ignoreTimeScale ? RealTime.deltaTime : Time.deltaTime) * speed;//Time.deltaTime;
|
||||
cellEnt.scaleTime = cellEnt.scaleTime > 1 ? 1 : cellEnt.scaleTime;
|
||||
tmpSize = scaleCurve.Evaluate(cellEnt.scaleTime);
|
||||
cellEnt.label.cachedTransform.localScale = new Vector3(tmpSize, tmpSize, 1f);
|
||||
|
||||
// Delete the entry when needed
|
||||
if (currentTime > totalEnd) Delete(cellEnt);
|
||||
else cellEnt.label.enabled = true;
|
||||
}
|
||||
|
||||
offset = 0f;
|
||||
// Move the entries
|
||||
for (int i = mList.Count; i > 0;)
|
||||
{
|
||||
cellEnt = mList[--i];
|
||||
if (cellEnt.stay < 0) continue;
|
||||
offset = Mathf.Max(offset, cellEnt.offset);
|
||||
cellEnt.label.cachedTransform.localPosition = new Vector3(0f, offset, 0f);
|
||||
|
||||
if (needQueue)
|
||||
{
|
||||
offset += Mathf.Round(cellEnt.label.cachedTransform.localScale.y * cellEnt.label.height + hightOffset); //modify by chenbin
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebbf080627224a44786e958729eb7601
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
@@ -0,0 +1,148 @@
|
||||
//--------------------------------------------
|
||||
// NGUI: HUD Text
|
||||
// Copyright © 2012 Tasharen Entertainment
|
||||
//--------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Attaching this script to an object will make it visibly follow another object, even if the two are using different cameras to draw them.
|
||||
/// </summary>
|
||||
|
||||
[AddComponentMenu("NGUI/Examples/Follow Target")]
|
||||
public class UIFollowTarget : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 3D target that this object will be positioned above.
|
||||
/// </summary>
|
||||
|
||||
public Transform target;
|
||||
public Vector3 targetPosition = Vector3.zero;
|
||||
public Camera mGameCamera;
|
||||
public Camera mUICamera;
|
||||
|
||||
public Vector3 offsetPos = Vector3.zero;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the children will be disabled when this object is no longer visible.
|
||||
/// </summary>
|
||||
|
||||
public bool disableIfInvisible = true;
|
||||
|
||||
Transform _mTrans;
|
||||
Transform mTrans {
|
||||
get {
|
||||
if(_mTrans == null) {
|
||||
_mTrans = transform;
|
||||
}
|
||||
return _mTrans;
|
||||
}
|
||||
}
|
||||
bool mIsVisible = false;
|
||||
bool isInitFinish = false;
|
||||
|
||||
/// <summary>
|
||||
/// Find both the UI camera and the game camera so they can be used for the position calculations
|
||||
/// </summary>
|
||||
|
||||
public void Start() // modify by chenbin
|
||||
{
|
||||
|
||||
if(isInitFinish) return;
|
||||
if (target != null)
|
||||
{
|
||||
mGameCamera = NGUITools.FindCameraForLayer(target.gameObject.layer);
|
||||
mUICamera = NGUITools.FindCameraForLayer(gameObject.layer);
|
||||
SetVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Expected to have 'target' set to a valid transform", this);
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCamera(Camera mCamera, Camera uiCamera){
|
||||
mGameCamera = mCamera;
|
||||
mUICamera = uiCamera;
|
||||
isInitFinish = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable or disable child objects.
|
||||
/// </summary>
|
||||
|
||||
void SetVisible (bool val)
|
||||
{
|
||||
mIsVisible = val;
|
||||
|
||||
for (int i = 0, imax = mTrans.childCount; i < imax; ++i)
|
||||
{
|
||||
NGUITools.SetActive(mTrans.GetChild(i).gameObject, val);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the position of the HUD object every frame such that is position correctly over top of its real world object.
|
||||
/// </summary>
|
||||
Vector3 pos;
|
||||
bool isVisible = false;
|
||||
public void LateUpdate ()
|
||||
{
|
||||
if (!isInitFinish)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(target != null)
|
||||
{
|
||||
pos = mGameCamera.WorldToViewportPoint(target.position + offsetPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = mGameCamera.WorldToViewportPoint(targetPosition+ offsetPos);
|
||||
}
|
||||
//Debug.Log("pos============" + pos);
|
||||
|
||||
// Determine the visibility and the target alpha
|
||||
isVisible = (pos.z > 0f && pos.x > 0f && pos.x < 1f && pos.y > 0f && pos.y < 1f);
|
||||
// Update the visibility flag
|
||||
if (disableIfInvisible && mIsVisible != isVisible) SetVisible(isVisible);
|
||||
|
||||
// If visible, update the position
|
||||
if (isVisible)
|
||||
{
|
||||
transform.position = mUICamera.ViewportToWorldPoint(pos);
|
||||
//Debug.Log("transform.position============" + transform.position);
|
||||
pos = mTrans.localPosition;
|
||||
pos.x = Mathf.RoundToInt(pos.x);
|
||||
pos.y = Mathf.RoundToInt(pos.y);
|
||||
pos.z = 0f;
|
||||
mTrans.localPosition = pos;
|
||||
//Debug.Log("mTrans.localPosition============" + mTrans.localPosition);
|
||||
} else {
|
||||
mTrans.localPosition = new Vector3(20000, 20000, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 getViewPos() {
|
||||
if(!isInitFinish) return Vector3.zero;
|
||||
Vector3 pos = mGameCamera.WorldToViewportPoint(target.position + offsetPos);
|
||||
pos.z = 0;
|
||||
return pos;
|
||||
}
|
||||
|
||||
public void setTarget(Transform target, Vector3 offset) {
|
||||
this.target = target;
|
||||
this.targetPosition = Vector3.zero;
|
||||
this.offsetPos = offset;
|
||||
LateUpdate ();
|
||||
}
|
||||
|
||||
public void setTargetPosition(Vector3 targetPosition, Vector3 offset)
|
||||
{
|
||||
this.target = null;
|
||||
this.targetPosition = targetPosition;
|
||||
this.offsetPos = offset;
|
||||
LateUpdate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13e6525715fcfe34eb1fa8e16533b3f6
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
Reference in New Issue
Block a user