-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/[Ll]ibrary/ | ||
/[Tt]emp/ | ||
/[Oo]bj/ | ||
/[Bb]uild/ | ||
/[Bb]uilds/ | ||
/Assets/AssetStoreTools* | ||
|
||
# Visual Studio 2015 cache directory | ||
/.vs/ | ||
|
||
# Autogenerated VS/MD/Consulo solution and project files | ||
ExportedObj/ | ||
.consulo/ | ||
*.csproj | ||
*.unityproj | ||
*.sln | ||
*.suo | ||
*.tmp | ||
*.user | ||
*.userprefs | ||
*.pidb | ||
*.booproj | ||
*.svd | ||
*.pdb | ||
|
||
# Unity3D generated meta files | ||
*.pidb.meta | ||
|
||
# Unity3D Generated File On Crash Reports | ||
sysinfo.txt | ||
|
||
# Builds | ||
*.apk | ||
*.unitypackage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class CameraFollow : MonoBehaviour { | ||
|
||
public GameObject cameraTarget; | ||
public GameObject player; | ||
|
||
public float smoothTime = 0.1f; | ||
public bool cameraFollowX = true; | ||
public bool cameraFollowY = true; | ||
public bool cameraFollowHeight = false; | ||
public float cameraHeight = 2.5f; | ||
public float xOffset = 1f; | ||
public Vector2 velocity; | ||
private Transform thisTransform; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
thisTransform = transform; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
if (cameraFollowX) { | ||
float newPosition = Mathf.SmoothDamp (thisTransform.position.x, cameraTarget.transform.position.x, ref velocity.x, smoothTime); | ||
|
||
thisTransform.position = new Vector3(newPosition, thisTransform.position.y, thisTransform.position.z); | ||
} | ||
|
||
if (cameraFollowY) { | ||
|
||
} | ||
|
||
if (!cameraFollowY && cameraFollowHeight) { | ||
|
||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class FadeDead : MonoBehaviour | ||
{ | ||
public int fadeSpeed = 3; | ||
private bool isDone = false; | ||
private Color matCol; | ||
private Color newColor; | ||
private float alfa = 0; | ||
|
||
// Use this for initialization | ||
void Start () | ||
{ | ||
Renderer renderer = gameObject.GetComponent<Renderer> (); | ||
matCol = renderer.material.color; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () | ||
{ | ||
Renderer renderer = gameObject.GetComponent<Renderer> (); | ||
if (!isDone) { | ||
alfa = renderer.material.color.a - Time.deltaTime / (fadeSpeed == 0 ? 1 : fadeSpeed); | ||
|
||
if (gameObject.GetComponent<Rigidbody2D>() && alfa < 0.7) { | ||
gameObject.GetComponent<Collider2D>().enabled = false; | ||
Destroy(gameObject.GetComponent<Rigidbody2D>()); | ||
} | ||
|
||
newColor = new Color (matCol.r, matCol.g, matCol.b, alfa); | ||
renderer.material.SetColor ("_Color", newColor); | ||
isDone = alfa <= 0 ? true : false; | ||
} else { | ||
gameObject.SetActive (false); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// (c) Copyright HutongGames, LLC 2010-2015. All rights reserved. | ||
//--- __ECO__ __ACTION__ ---// | ||
|
||
using UnityEngine; | ||
|
||
namespace HutongGames.PlayMaker.Actions | ||
{ | ||
[ActionCategory("uGui")] | ||
[Tooltip("Sets the text value of a UGui Text component.")] | ||
public class uGuiTextSetText : FsmStateAction | ||
{ | ||
[RequiredField] | ||
[CheckForComponent(typeof(UnityEngine.UI.Text))] | ||
[Tooltip("The GameObject with the text ui component.")] | ||
public FsmOwnerDefault gameObject; | ||
|
||
[RequiredField] | ||
[UIHint(UIHint.TextArea)] | ||
[Tooltip("The text of the UGui Text component.")] | ||
public FsmString text; | ||
|
||
[Tooltip("Reset when exiting this state.")] | ||
public FsmBool resetOnExit; | ||
|
||
[Tooltip("Repeats every frame")] | ||
public bool everyFrame; | ||
|
||
private UnityEngine.UI.Text _text; | ||
string _originalString; | ||
|
||
public override void Reset() | ||
{ | ||
gameObject = null; | ||
text = null; | ||
resetOnExit = null; | ||
everyFrame = false; | ||
} | ||
|
||
public override void OnEnter() | ||
{ | ||
|
||
GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject); | ||
if (_go!=null) | ||
{ | ||
_text = _go.GetComponent<UnityEngine.UI.Text>(); | ||
} | ||
|
||
if (resetOnExit.Value) | ||
{ | ||
_originalString = _text.text; | ||
} | ||
|
||
DoSetTextValue(); | ||
|
||
if (!everyFrame) | ||
{ | ||
Finish(); | ||
} | ||
} | ||
|
||
public override void OnUpdate() | ||
{ | ||
DoSetTextValue(); | ||
} | ||
|
||
void DoSetTextValue() | ||
{ | ||
|
||
if (_text!=null) | ||
{ | ||
_text.text = text.Value; | ||
} | ||
} | ||
|
||
public override void OnExit() | ||
{ | ||
if (_text==null) | ||
{ | ||
return; | ||
} | ||
|
||
if (resetOnExit.Value) | ||
{ | ||
_text.text = _originalString; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.