Browse Source

added text when a character moves

master
JoshuaReason 5 years ago
parent
commit
ddf1b5718f
10 changed files with 528 additions and 60 deletions
  1. +3
    -0
      Assets/Prefabs/Character.prefab
  2. +257
    -0
      Assets/Prefabs/UI/BlockDisplay.prefab
  3. +7
    -0
      Assets/Prefabs/UI/BlockDisplay.prefab.meta
  4. +78
    -58
      Assets/Scripts/Character.cs
  5. +2
    -0
      Assets/Scripts/Logic/Blocks/LogicBlock.cs
  6. +58
    -0
      Assets/Scripts/UI/MoveAndFade.cs
  7. +11
    -0
      Assets/Scripts/UI/MoveAndFade.cs.meta
  8. +102
    -0
      Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline - Overlay.mat
  9. +8
    -0
      Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline - Overlay.mat.meta
  10. +2
    -2
      Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset

+ 3
- 0
Assets/Prefabs/Character.prefab View File

@ -53,7 +53,10 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
m_Bits: 0 m_Bits: 0
Inventory: {fileID: 11400000, guid: b6fa892e4c159bf46a2c4cda19627e97, type: 2} Inventory: {fileID: 11400000, guid: b6fa892e4c159bf46a2c4cda19627e97, type: 2}
CloneInventoryOnStart: 0
CharacterModel: Bear CharacterModel: Bear
BlockTitlePrefab: {fileID: 2973609366961395955, guid: a8f8864af2acceb469d3c0ee1bad8588,
type: 3}
--- !u!114 &2631002120179805110 --- !u!114 &2631002120179805110
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

+ 257
- 0
Assets/Prefabs/UI/BlockDisplay.prefab View File

@ -0,0 +1,257 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1662343220797568941
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 192529712932535494}
- component: {fileID: 7324986156724371615}
- component: {fileID: 4827153297796465100}
- component: {fileID: 1035212709628659733}
- component: {fileID: 2973609366961395955}
- component: {fileID: 161217825502433520}
m_Layer: 0
m_Name: BlockDisplay
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &192529712932535494
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662343220797568941}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -3}
m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 1, y: 1.82}
m_SizeDelta: {x: 1.456, y: 0.323}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &7324986156724371615
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662343220797568941}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c2e21a7b8a58d15489b2839c03b674e6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 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 &4827153297796465100
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662343220797568941}
m_Mesh: {fileID: 0}
--- !u!222 &1035212709628659733
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662343220797568941}
m_CullTransparentMesh: 0
--- !u!114 &2973609366961395955
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662343220797568941}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_text: Move
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: c2e21a7b8a58d15489b2839c03b674e6, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4279485175
m_fontColor: {r: 0.9716981, g: 0.7637698, b: 0.0779192, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 2.85
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 2
m_fontSizeMax: 10
m_fontStyle: 0
m_textAlignment: 514
m_isAlignmentEnumConverted: 1
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 2973609366961395955}
characterCount: 4
spriteCount: 0
spaceCount: 0
wordCount: 1
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 0
m_inputSource: 0
m_hasFontAssetChanged: 0
m_renderer: {fileID: 7324986156724371615}
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_maskType: 0
--- !u!114 &161217825502433520
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662343220797568941}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 013a627e0fe2ce64081883ad85e9fec2, type: 3}
m_Name:
m_EditorClassIdentifier:
AnimationTime: 0.7
EndPoint: {x: 0, y: 0.1, z: 0}
FadeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: -0.0041656494
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.7400386
value: 0.07569887
inSlope: 0.15106222
outSlope: 0.13821022
tangentMode: 1
weightedMode: 0
inWeight: 0.17673188
outWeight: 1
- serializedVersion: 3
time: 1
value: 1
inSlope: 7.0754776
outSlope: 7.0754776
tangentMode: 0
weightedMode: 0
inWeight: 0.016597511
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4

+ 7
- 0
Assets/Prefabs/UI/BlockDisplay.prefab.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a8f8864af2acceb469d3c0ee1bad8588
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 78
- 58
Assets/Scripts/Character.cs View File

@ -7,7 +7,7 @@ using UnityEngine.SceneManagement;
public class Character : MonoBehaviour public class Character : MonoBehaviour
{ {
public string nextScene; public string nextScene;
Animator characterAnimator;
Animator characterAnimator;
#region Inspector Fields #region Inspector Fields
@ -27,6 +27,9 @@ public class Character : MonoBehaviour
[Tooltip("Character to display")] [Tooltip("Character to display")]
private string CharacterModel = "Bear"; private string CharacterModel = "Bear";
[SerializeField]
private TMPro.TextMeshPro BlockTitlePrefab;
#endregion Inspector Fields #endregion Inspector Fields
#region Read Only #region Read Only
@ -38,7 +41,7 @@ public class Character : MonoBehaviour
private void Start() private void Start()
{ {
if (Inventory != null && CloneInventoryOnStart) if (Inventory != null && CloneInventoryOnStart)
Inventory = Inventory.Clone(Inventory);
Inventory = Inventory.Clone(Inventory);
//If no starting block find one below it //If no starting block find one below it
if (_currentBlock == null) if (_currentBlock == null)
@ -54,74 +57,87 @@ public class Character : MonoBehaviour
characterAnimator = GetComponentInChildren<Animator>(); characterAnimator = GetComponentInChildren<Animator>();
} }
#endregion Unity Functions #endregion Unity Functions
#region Class Implementation #region Class Implementation
public void Initialise(Block startingBlock, Inventory inventory, string Character) {
public void Initialise(Block startingBlock, Inventory inventory, string Character)
{
_currentBlock = startingBlock; _currentBlock = startingBlock;
Inventory = inventory; Inventory = inventory;
CharacterModel = Character; CharacterModel = Character;
} }
public void DisplayBlock(LogicBlock block)
{
if (BlockTitlePrefab == null)
return;
TMPro.TextMeshPro temp = Instantiate(BlockTitlePrefab.gameObject).GetComponent<TMPro.TextMeshPro>();
temp.text = block.DisplayName;
temp.color = block.Color;
temp.transform.position = transform.position + (Vector3.one * 0.25f);
temp.transform.rotation = Quaternion.LookRotation(temp.transform.position - Camera.main.transform.position);
}
public Vector3 yValue(float time, float heightMultiplier) public Vector3 yValue(float time, float heightMultiplier)
{ {
float y = Mathf.Sin((Mathf.PI*time)) * heightMultiplier;
float y = Mathf.Sin((Mathf.PI * time)) * heightMultiplier;
return new Vector3(0, y, 0); return new Vector3(0, y, 0);
} }
IEnumerator JumpCoroutine(Block Target, Transform Current, float time, float heightMax)
{
float elapsedTime = 0;
Vector3 startPosition = Current.position;
time *= 0.8f;
IEnumerator JumpCoroutine(Block Target, Transform Current, float time, float heightMax)
{
float elapsedTime = 0;
Vector3 startPosition = Current.position;
time *= 0.8f;
characterAnimator.Play("Jump Inplace"); characterAnimator.Play("Jump Inplace");
yield return new WaitForSeconds(0.15f); yield return new WaitForSeconds(0.15f);
while (elapsedTime < time) while (elapsedTime < time)
{
{
transform.position = Vector3.Lerp(startPosition, Target.VisualPosition, (elapsedTime / time)); transform.position = Vector3.Lerp(startPosition, Target.VisualPosition, (elapsedTime / time));
transform.position += yValue((elapsedTime / time), heightMax);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}
transform.position = Target.VisualPosition;
}
transform.position += yValue((elapsedTime / time), heightMax);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}
transform.position = Target.VisualPosition;
}
IEnumerator MoveCoroutine(Block Target, Transform Current, float time, float heightMax) IEnumerator MoveCoroutine(Block Target, Transform Current, float time, float heightMax)
{ {
float elapsedTime = 0; float elapsedTime = 0;
Vector3 startPosition = Current.position; Vector3 startPosition = Current.position;
time *= 0.8f; time *= 0.8f;
characterAnimator.Play("Walk");
yield return new WaitForSeconds(0.05f);
characterAnimator.Play("Walk");
yield return new WaitForSeconds(0.05f);
while (elapsedTime < time) while (elapsedTime < time)
{ {
transform.position = Vector3.Lerp(startPosition, Target.VisualPosition, (elapsedTime / time)); transform.position = Vector3.Lerp(startPosition, Target.VisualPosition, (elapsedTime / time));
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
} }
transform.position = Target.VisualPosition; transform.position = Target.VisualPosition;
} }
IEnumerator MoveDownCoroutine(Block Target, Transform Current, float time, float heightMax)
{
float elapsedTime = 0;
Vector3 startPosition = Current.position;
time *= 0.8f;
characterAnimator.Play("Walk");
while (elapsedTime < time)
{
transform.position = Vector3.Lerp(startPosition, Target.VisualPosition, (elapsedTime / time));
transform.position += yValue((elapsedTime / time), heightMax);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}
transform.position = Target.VisualPosition;
}
IEnumerator MoveDownCoroutine(Block Target, Transform Current, float time, float heightMax)
{
float elapsedTime = 0;
Vector3 startPosition = Current.position;
time *= 0.8f;
characterAnimator.Play("Walk");
while (elapsedTime < time)
{
transform.position = Vector3.Lerp(startPosition, Target.VisualPosition, (elapsedTime / time));
transform.position += yValue((elapsedTime / time), heightMax);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}
transform.position = Target.VisualPosition;
}
IEnumerator rotateCoroutine(Direction direction, Transform Current, float time, float heightMax) IEnumerator rotateCoroutine(Direction direction, Transform Current, float time, float heightMax)
{ {
@ -132,7 +148,7 @@ public class Character : MonoBehaviour
Vector3 startPosition = transform.position; Vector3 startPosition = transform.position;
while (elapsedTime < time) while (elapsedTime < time)
{ {
characterAnimator.Play("Jump");
characterAnimator.Play("Jump");
transform.forward = Vector3.Slerp(startDirection, endDirection, (elapsedTime / time)); transform.forward = Vector3.Slerp(startDirection, endDirection, (elapsedTime / time));
yield return new WaitForEndOfFrame(); yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime; elapsedTime += Time.deltaTime;
@ -147,7 +163,7 @@ public class Character : MonoBehaviour
/// <param name="direction">direction to walk</param> /// <param name="direction">direction to walk</param>
/// <remarks>Technically is same as JumpLong(1) but kept seperate to avoid confusion</remarks> /// <remarks>Technically is same as JumpLong(1) but kept seperate to avoid confusion</remarks>
public void Move(Direction direction, float speed) public void Move(Direction direction, float speed)
{
{
//setting up variables //setting up variables
Vector3 position = _currentBlock.position + direction.ToVector(transform); // position wanted Vector3 position = _currentBlock.position + direction.ToVector(transform); // position wanted
Block hit; //output of block detection Block hit; //output of block detection
@ -159,16 +175,19 @@ public class Character : MonoBehaviour
//If block at Position is walkable set it to moveTo //If block at Position is walkable set it to moveTo
if (Block.isBlockAtPosition(position, 1, ~Ignore, out hit) && hit.isWalkable(~Ignore)){
if (Block.isBlockAtPosition(position, 1, ~Ignore, out hit) && hit.isWalkable(~Ignore))
{
moveTo = hit; moveTo = hit;
_currentBlock = moveTo;
StartCoroutine(MoveCoroutine(_currentBlock, transform, speed, 0.3f)); }
_currentBlock = moveTo;
StartCoroutine(MoveCoroutine(_currentBlock, transform, speed, 0.3f));
}
//else if block down one is walkable //else if block down one is walkable
else if (Block.isBlockAtPosition(position + Vector3.down, 1, ~Ignore, out hit) && hit.isWalkable(~Ignore)){
else if (Block.isBlockAtPosition(position + Vector3.down, 1, ~Ignore, out hit) && hit.isWalkable(~Ignore))
{
moveTo = hit; moveTo = hit;
_currentBlock = moveTo;
StartCoroutine(MoveDownCoroutine(_currentBlock, transform, speed, 0.3f));
}
_currentBlock = moveTo;
StartCoroutine(MoveDownCoroutine(_currentBlock, transform, speed, 0.3f));
}
//set current block && move //set current block && move
//CurrentBlock = moveTo; //CurrentBlock = moveTo;
//StartCoroutine(MoveCoroutine(CurrentBlock, transform, speed, 0.3f)); //StartCoroutine(MoveCoroutine(CurrentBlock, transform, speed, 0.3f));
@ -176,10 +195,10 @@ public class Character : MonoBehaviour
} }
/// <summary> /// <summary>
/// Upon collision with a floating block, collect its
/// Upon collision with the end portal, end of level
/// </summary>
/// <param name="other">name of collided object</param>
/// Upon collision with a floating block, collect its
/// Upon collision with the end portal, end of level
/// </summary>
/// <param name="other">name of collided object</param>
void OnTriggerEnter(Collider other) void OnTriggerEnter(Collider other)
{ {
Collectable collectable = other.GetComponentInChildren<Collectable>(); Collectable collectable = other.GetComponentInChildren<Collectable>();
@ -188,11 +207,12 @@ public class Character : MonoBehaviour
{ {
collectable.OnCollect(this); collectable.OnCollect(this);
} }
if (other.gameObject.name == "collect_sphere"){
other.gameObject.SetActive(false);
//player.collected +=1;
if (other.gameObject.name == "collect_sphere")
{
other.gameObject.SetActive(false);
//player.collected +=1;
}
}
if (other.gameObject.name == "End Portal") if (other.gameObject.name == "End Portal")
{ {
other.GetComponent<Collider>().enabled = false; other.GetComponent<Collider>().enabled = false;
@ -249,10 +269,10 @@ public class Character : MonoBehaviour
if (Block.isBlockAtPosition(position, 1, ~Ignore, out hit) && hit.isWalkable(~Ignore)) if (Block.isBlockAtPosition(position, 1, ~Ignore, out hit) && hit.isWalkable(~Ignore))
moveTo = hit; moveTo = hit;
} }
//set current block && move //set current block && move
_currentBlock = moveTo; _currentBlock = moveTo;
StartCoroutine(JumpCoroutine(_currentBlock, transform, speed, 0.5f));
StartCoroutine(JumpCoroutine(_currentBlock, transform, speed, 0.5f));
//transform.position = CurrentBlock.VisualPosition; //transform.position = CurrentBlock.VisualPosition;
} }
@ -287,10 +307,10 @@ public class Character : MonoBehaviour
moveTo = hit; moveTo = hit;
}//end for }//end for
//Set Current Block and move //Set Current Block and move
_currentBlock = moveTo; _currentBlock = moveTo;
StartCoroutine(JumpCoroutine(_currentBlock, transform, speed, 0.5f));
StartCoroutine(JumpCoroutine(_currentBlock, transform, speed, 0.5f));
//transform.position = CurrentBlock.VisualPosition; //transform.position = CurrentBlock.VisualPosition;
} }

+ 2
- 0
Assets/Scripts/Logic/Blocks/LogicBlock.cs View File

@ -57,6 +57,8 @@ public abstract class LogicBlock : ScriptableObject
RepeatCount++; RepeatCount++;
BlockLogic(player, animationTime); BlockLogic(player, animationTime);
player.DisplayBlock(this);
return isFinished(); return isFinished();
} }

+ 58
- 0
Assets/Scripts/UI/MoveAndFade.cs View File

@ -0,0 +1,58 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
[RequireComponent(typeof(TextMeshPro))]
public class MoveAndFade : MonoBehaviour
{
[SerializeField]
private float AnimationTime;
[SerializeField]
[Tooltip("End point in local position")]
private Vector3 EndPoint;
[SerializeField]
private AnimationCurve FadeCurve;
private TextMeshPro text;
private void Start()
{
text = GetComponent<TextMeshPro>();
StartCoroutine(FadeAndMove());
}
private IEnumerator FadeAndMove()
{
Vector3 startPoint = transform.position;
Vector3 endPoint = transform.position + EndPoint;
float startAlpha = text.color.a;
float elapsedTime = 0;
while(elapsedTime < AnimationTime)
{
float ratio = elapsedTime / AnimationTime;
float fadeValue = Mathf.Lerp(startAlpha,0.0f, FadeCurve.Evaluate(ratio));
text.color = new Color(text.color.r, text.color.g, text.color.b, fadeValue);
transform.position = Vector3.Lerp(startPoint, endPoint, ratio);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}
Destroy(gameObject);
}
}

+ 11
- 0
Assets/Scripts/UI/MoveAndFade.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 013a627e0fe2ce64081883ad85e9fec2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 102
- 0
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline - Overlay.mat View File

@ -0,0 +1,102 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LiberationSans SDF - Outline - Overlay
m_Shader: {fileID: 4800000, guid: a02a7d8c237544f1962732b55a9aebf1, type: 3}
m_ShaderKeywords: OUTLINE_ON
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Cube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2846298, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelRoundness: 0
- _BevelWidth: 0
- _BumpFace: 0
- _BumpOutline: 0
- _ColorMask: 15
- _Diffuse: 0.5
- _FaceDilate: 0.1
- _FaceUVSpeedX: 0
- _FaceUVSpeedY: 0
- _GlowInner: 0.05
- _GlowOffset: 0
- _GlowOuter: 0.05
- _GlowPower: 0.75
- _GradientScale: 10
- _LightAngle: 3.1416
- _MaskSoftnessX: 0
- _MaskSoftnessY: 0
- _OutlineSoftness: 0
- _OutlineUVSpeedX: 0
- _OutlineUVSpeedY: 0
- _OutlineWidth: 0.1
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _ScaleRatioA: 0.9
- _ScaleRatioB: 0.73125
- _ScaleRatioC: 0.64125
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
- _SpecularPower: 2
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _TextureHeight: 1024
- _TextureWidth: 1024
- _UnderlayDilate: 0
- _UnderlayOffsetX: 0
- _UnderlayOffsetY: 0
- _UnderlaySoftness: 0
- _VertexOffsetX: 0
- _VertexOffsetY: 0
- _WeightBold: 0.75
- _WeightNormal: 0
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}

+ 8
- 0
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline - Overlay.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c2e21a7b8a58d15489b2839c03b674e6
timeCreated: 1484172856
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 2
- 2
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:f304c62a5f0ae05d242f436f372e541d7761497233e4022f606341380148a78f
size 2173902
oid sha256:277a4a5984725c4233f3f633fafa25b65468e01502eb4412444f169070aad458
size 2174066

Loading…
Cancel
Save