Browse Source

Added particle effects, also movers, also background

master
Joshua Reason 7 years ago
parent
commit
85afc0dd8d
44 changed files with 685 additions and 16 deletions
  1. BIN
      singleTap/SingleTap/Assets/Materials/BackGround.mat
  2. +8
    -0
      singleTap/SingleTap/Assets/Materials/BackGround.mat.meta
  3. BIN
      singleTap/SingleTap/Assets/Materials/MissileMaterial.mat
  4. +8
    -0
      singleTap/SingleTap/Assets/Materials/MissileMaterial.mat.meta
  5. +0
    -0
      singleTap/SingleTap/Assets/Materials/Particle.mat
  6. +0
    -0
      singleTap/SingleTap/Assets/Materials/Particle.mat.meta
  7. BIN
      singleTap/SingleTap/Assets/Materials/Player.mat
  8. BIN
      singleTap/SingleTap/Assets/Materials/PlayerHealth1.mat
  9. +8
    -0
      singleTap/SingleTap/Assets/Materials/PlayerHealth1.mat.meta
  10. BIN
      singleTap/SingleTap/Assets/Materials/PlayerHealth2.mat
  11. +8
    -0
      singleTap/SingleTap/Assets/Materials/PlayerHealth2.mat.meta
  12. BIN
      singleTap/SingleTap/Assets/Materials/PlayerPointer.mat
  13. +9
    -0
      singleTap/SingleTap/Assets/Objects.meta
  14. BIN
      singleTap/SingleTap/Assets/Objects/16_9Tile.fbx
  15. +76
    -0
      singleTap/SingleTap/Assets/Objects/16_9Tile.fbx.meta
  16. +9
    -0
      singleTap/SingleTap/Assets/Prefabs.meta
  17. BIN
      singleTap/SingleTap/Assets/Prefabs/Enemy.prefab
  18. +8
    -0
      singleTap/SingleTap/Assets/Prefabs/Enemy.prefab.meta
  19. BIN
      singleTap/SingleTap/Assets/Prefabs/EnemyMissile.prefab
  20. +0
    -0
      singleTap/SingleTap/Assets/Prefabs/EnemyMissile.prefab.meta
  21. BIN
      singleTap/SingleTap/Assets/Prefabs/Mover.prefab
  22. +8
    -0
      singleTap/SingleTap/Assets/Prefabs/Mover.prefab.meta
  23. +0
    -0
      singleTap/SingleTap/Assets/Prefabs/bullet.prefab.meta
  24. BIN
      singleTap/SingleTap/Assets/Prefabs/explosion 1.prefab
  25. +8
    -0
      singleTap/SingleTap/Assets/Prefabs/explosion 1.prefab.meta
  26. +66
    -0
      singleTap/SingleTap/Assets/Scripts/BackgroundController.cs
  27. +12
    -0
      singleTap/SingleTap/Assets/Scripts/BackgroundController.cs.meta
  28. +8
    -4
      singleTap/SingleTap/Assets/Scripts/EnemyController.cs
  29. +15
    -1
      singleTap/SingleTap/Assets/Scripts/MissileController.cs
  30. +73
    -0
      singleTap/SingleTap/Assets/Scripts/MoverController.cs
  31. +12
    -0
      singleTap/SingleTap/Assets/Scripts/MoverController.cs.meta
  32. +62
    -7
      singleTap/SingleTap/Assets/Scripts/PlayerController.cs
  33. +49
    -0
      singleTap/SingleTap/Assets/Scripts/SparkParticles.cs
  34. +12
    -0
      singleTap/SingleTap/Assets/Scripts/SparkParticles.cs.meta
  35. +4
    -4
      singleTap/SingleTap/Assets/Scripts/TapDetector.cs
  36. +9
    -0
      singleTap/SingleTap/Assets/Shaders.meta
  37. +81
    -0
      singleTap/SingleTap/Assets/Shaders/BackGroundEffect.shader
  38. +9
    -0
      singleTap/SingleTap/Assets/Shaders/BackGroundEffect.shader.meta
  39. +9
    -0
      singleTap/SingleTap/Assets/Textures.meta
  40. BIN
      singleTap/SingleTap/Assets/Textures/ConeGradience.png
  41. +57
    -0
      singleTap/SingleTap/Assets/Textures/ConeGradience.png.meta
  42. BIN
      singleTap/SingleTap/Assets/Textures/CubeNoise.jpg
  43. +57
    -0
      singleTap/SingleTap/Assets/Textures/CubeNoise.jpg.meta
  44. BIN
      singleTap/SingleTap/Assets/_Scenes/TestScene.unity

BIN
singleTap/SingleTap/Assets/Materials/BackGround.mat View File


+ 8
- 0
singleTap/SingleTap/Assets/Materials/BackGround.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0e8c53a8841f1d04a857fdc959f50a30
timeCreated: 1471477532
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/Materials/MissileMaterial.mat View File


+ 8
- 0
singleTap/SingleTap/Assets/Materials/MissileMaterial.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 050d321b8c53c7f4f893f7e604850662
timeCreated: 1471482226
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

singleTap/SingleTap/Assets/Particle.mat → singleTap/SingleTap/Assets/Materials/Particle.mat View File


singleTap/SingleTap/Assets/Particle.mat.meta → singleTap/SingleTap/Assets/Materials/Particle.mat.meta View File


BIN
singleTap/SingleTap/Assets/Materials/Player.mat View File


BIN
singleTap/SingleTap/Assets/Materials/PlayerHealth1.mat View File


+ 8
- 0
singleTap/SingleTap/Assets/Materials/PlayerHealth1.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77c9f22d12edb01499287b4b87c39abe
timeCreated: 1471485949
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/Materials/PlayerHealth2.mat View File


+ 8
- 0
singleTap/SingleTap/Assets/Materials/PlayerHealth2.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 706b2632b5216154686a63fd0522f3a7
timeCreated: 1471485965
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/Materials/PlayerPointer.mat View File


+ 9
- 0
singleTap/SingleTap/Assets/Objects.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f4356aaaec66b214888e3b4b25eadc71
folderAsset: yes
timeCreated: 1471484700
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/Objects/16_9Tile.fbx View File


+ 76
- 0
singleTap/SingleTap/Assets/Objects/16_9Tile.fbx.meta View File

@ -0,0 +1,76 @@
fileFormatVersion: 2
guid: 53fffb8f8bc7ba14f89452aff8b57784
timeCreated: 1471477532
licenseType: Free
ModelImporter:
serializedVersion: 19
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2300000: //RootNode
3300000: //RootNode
4300000: Plane
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleRotations: 1
optimizeGameObjects: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

+ 9
- 0
singleTap/SingleTap/Assets/Prefabs.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 974f51ff6466c334fa3c82d49b6e4fcb
folderAsset: yes
timeCreated: 1471484714
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/bullet.prefab → singleTap/SingleTap/Assets/Prefabs/Enemy.prefab View File


+ 8
- 0
singleTap/SingleTap/Assets/Prefabs/Enemy.prefab.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9c3bdc3cf0409b244bd3d018994f45bb
timeCreated: 1471493774
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/EnemyMissile.prefab → singleTap/SingleTap/Assets/Prefabs/EnemyMissile.prefab View File


singleTap/SingleTap/Assets/EnemyMissile.prefab.meta → singleTap/SingleTap/Assets/Prefabs/EnemyMissile.prefab.meta View File


BIN
singleTap/SingleTap/Assets/Prefabs/Mover.prefab View File


+ 8
- 0
singleTap/SingleTap/Assets/Prefabs/Mover.prefab.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3cce71904fda3cd4a8a338b2cfa6c9bf
timeCreated: 1471493768
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

singleTap/SingleTap/Assets/bullet.prefab.meta → singleTap/SingleTap/Assets/Prefabs/bullet.prefab.meta View File


BIN
singleTap/SingleTap/Assets/Prefabs/explosion 1.prefab View File


+ 8
- 0
singleTap/SingleTap/Assets/Prefabs/explosion 1.prefab.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 61a40ddea037e1442928296063bc82b4
timeCreated: 1471485417
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 66
- 0
singleTap/SingleTap/Assets/Scripts/BackgroundController.cs View File

@ -0,0 +1,66 @@
using UnityEngine;
using System.Collections;
public class BackgroundController : MonoBehaviour {
public float transistionSpeed = 1f;
public float waitTime = 10f;
private Material mat;
private float lastTransition = 0.0f;
private bool inverseDirection = false;
// Use this for initialization
void Start () {
mat = GetComponent<Renderer>().material;
}
// Update is called once per frame
void FixedUpdate () {
if (Time.time - lastTransition >= waitTime) {
lastTransition = Time.time;
StartCoroutine(transition(transistionSpeed));
}
}
private IEnumerator transition(float time) {
float transitionStart = -1;
float transitionEnd = 1;
if (inverseDirection) {
mat.SetFloat("_InvertMap", 1);
}else {
mat.SetFloat("_InvertMap", 0);
}
float elapsedTime = 0;
float transitionFrac = transitionStart;
while ((elapsedTime/ time) <=1) {
transitionFrac = Mathf.Lerp(transitionStart, transitionEnd, (elapsedTime / time));
transitionFrac = (inverseDirection)? transitionFrac : -transitionFrac;
mat.SetFloat("_TimeNode", transitionFrac);
elapsedTime += Time.deltaTime;
yield return new WaitForEndOfFrame();
}
if (inverseDirection) {
mat.SetFloat("_TimeNode", 1);
} else {
mat.SetFloat("_TimeNode", -1);
}
inverseDirection = !inverseDirection;
}
}

+ 12
- 0
singleTap/SingleTap/Assets/Scripts/BackgroundController.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9a7bd545185bc6e4884a8571592f7e0d
timeCreated: 1471477977
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 4
singleTap/SingleTap/Assets/Scripts/EnemyController.cs View File

@ -11,11 +11,13 @@ public class EnemyController : InteractableObject {
private Rigidbody2D playerRigid;
public GameObject bullet;
public float shotCoolDown = 0.5f;
private float lastShotTime = 0.0f;
public float initShotWait = 0.0f;
protected float lastShotTime = 0.0f;
private GameObject healthDisp;
// Use this for initialization
void Start () {
protected virtual void Start () {
lastShotTime += initShotWait;
healthDisp = GetComponentInChildren<ParticleSystem>().gameObject;
player = GameObject.FindGameObjectWithTag("Player");
playerRigid = player.GetComponent<Rigidbody2D>();
@ -35,7 +37,7 @@ public class EnemyController : InteractableObject {
}
private void shoot(Vector2 startVelocity) {
protected void shoot(Vector2 startVelocity) {
GameObject bulletClone = (GameObject)Instantiate(bullet, transform.position, transform.rotation);
MissileController bulletScript = bulletClone.GetComponent<MissileController>();
bulletScript.startVelocity = startVelocity;
@ -62,7 +64,9 @@ public class EnemyController : InteractableObject {
Vector3 newScale = new Vector3(health / 10f, health / 10f, health / 10f);
Debug.Log("new scale = " + newScale);
healthDisp.transform.localScale = newScale;
if (healthDisp != null) {
healthDisp.transform.localScale = newScale;
}
transform.localScale = newScale;
}

+ 15
- 1
singleTap/SingleTap/Assets/Scripts/MissileController.cs View File

@ -9,6 +9,8 @@ public class MissileController : MonoBehaviour {
public float initVelocity = 5;
public float boostCoolDown = 0.3f;
public float difficulty = 0.0f;
public ParticleSystem boostEffect;
public GameObject Explosion;
[HideInInspector]
public Vector3 startVelocity;
@ -63,6 +65,13 @@ public class MissileController : MonoBehaviour {
}
private void moveTorwards(Vector3 pos) {
if (boostEffect != null) {
Debug.Log("Playing Boost");
boostEffect.startRotation = transform.rotation.eulerAngles.z * Mathf.Deg2Rad;
boostEffect.Play();
}
Vector2 direction = (pos - transform.position).normalized;
Debug.DrawLine(transform.position, pos, Color.green,0.3f);
rigid.velocity = direction * speed;
@ -87,13 +96,18 @@ public class MissileController : MonoBehaviour {
InteractableObject colScript = coll.gameObject.GetComponent<InteractableObject>();
if (colScript == null || colScript == spawningObject ) {
Debug.Log("I ignored " + coll.gameObject.name);
// Debug.Log("I ignored " + coll.gameObject.name);
return;
}
Debug.Log("I hit " + coll.gameObject.name);
colScript.shot();
if (Explosion != null)
Instantiate(Explosion, transform.position,transform.rotation);
Destroy(this.gameObject);
}

+ 73
- 0
singleTap/SingleTap/Assets/Scripts/MoverController.cs View File

@ -0,0 +1,73 @@
using UnityEngine;
using System.Collections;
public class MoverController : EnemyController {
public Transform[] moveRoute;
public float moveSpeed;
public float moveCoolDown = 2;
public int routeLoc = 0;
private int routeMax;
private bool isMove = false;
private float lastMoveTime = 0.5f;
// Use this for initialization
protected override void Start () {
base.Start();
routeMax = moveRoute.Length;
transform.position = moveRoute[routeLoc % routeMax].position;
}
// Update is called once per frame
void FixedUpdate () {
if (Time.time - lastShotTime >= shotCoolDown) {
lastShotTime = Time.time;
Vector3 dir1 = (moveRoute[(routeLoc + 1) % routeMax].position - moveRoute[routeLoc % routeMax].position).normalized;
Vector3 dir2 = (moveRoute[mod ((routeLoc - 1), routeMax)].position - moveRoute[routeLoc % routeMax].position).normalized;
shoot(dir1);
shoot(dir2);
}
if (Time.time - lastMoveTime >= moveCoolDown) {
lastMoveTime = Time.time;
StartCoroutine(moveLocation(moveSpeed));
}
}
private IEnumerator moveLocation(float time) {
Vector3 start = moveRoute[routeLoc % routeMax].position;
Vector3 end = moveRoute[(routeLoc + 1 ) % routeMax].position;
float elapsedTime = 0;
Vector3 pos = start;
while ((elapsedTime / time) <= 1) {
pos = Vector3.Lerp(start, end, (elapsedTime / time));
transform.position = pos;
elapsedTime += Time.deltaTime;
yield return new WaitForEndOfFrame();
}
transform.position = end;
routeLoc++;
}
//c# modulo deals with negatives differently because it is a remainder call
//this fixes that
private int mod(int x, int m) {
return (x % m + m) % m;
}
}

+ 12
- 0
singleTap/SingleTap/Assets/Scripts/MoverController.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c208473e04a5251459c03316635f17fd
timeCreated: 1471490311
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 62
- 7
singleTap/SingleTap/Assets/Scripts/PlayerController.cs View File

@ -2,22 +2,26 @@
using System.Collections;
[RequireComponent(typeof(Rigidbody2D))]
public class PlayerController : MonoBehaviour {
public class PlayerController : InteractableObject {
public GameObject bullet;
public float speed;
public int health;
public Renderer healthMat;
public Color[] healthColor;
public GameObject Explosion;
public ParticleSystem boostEffect;
private int bulletDirection = -1;
private Rigidbody2D rigid;
private GameObject[] targets;
private float lastHit = 0.0f;
private bool isDead = false;
// Use this for initialization
void Start() {
targets = GameObject.FindGameObjectsWithTag("Enemy");
rigid = GetComponent<Rigidbody2D>();
rigid.AddForce(Vector2.up * 200);
rigid.AddForce(Vector2.right * 200);
}
@ -30,6 +34,9 @@ public class PlayerController : MonoBehaviour {
public void rotatePlayer() {
if (isDead)
return;
rigid.velocity = Vector3.zero;
transform.Rotate(new Vector3(0, 0, 5f));
@ -37,6 +44,12 @@ public class PlayerController : MonoBehaviour {
}
public void movePlayer() {
if (isDead)
return;
//Debug.Log(transform.rotation.eulerAngles.z * Mathf.Deg2Rad);
boostEffect.startRotation = -transform.rotation.eulerAngles.z * Mathf.Deg2Rad;
boostEffect.Play();
rigid.AddForce(transform.right * speed,ForceMode2D.Impulse);
@ -44,7 +57,10 @@ public class PlayerController : MonoBehaviour {
GameObject findClosestTarget(GameObject[] targets) {
GameObject findClosestTarget() {
GameObject[] targets = GameObject.FindGameObjectsWithTag("Enemy");
GameObject tMin = null;
float minDist = Mathf.Infinity;
Vector3 currentPos = transform.position;
@ -59,13 +75,52 @@ public class PlayerController : MonoBehaviour {
}
public void shoot() {
if (isDead)
return;
GameObject bulletClone = (GameObject)Instantiate(bullet, transform.position + (transform.up * bulletDirection * 0.1f), transform.rotation);
MissileController bulletScript = bulletClone.GetComponent<MissileController>();
bulletScript.startVelocity = transform.up * bulletDirection;
bulletDirection = -bulletDirection;
bulletScript.target = findClosestTarget(targets);
bulletScript.ignoreList = GetComponents<Collider2D>();
bulletScript.target = findClosestTarget();
bulletScript.enabled = true;
}
private void setDead() {
rigid.angularDrag = 0;
rigid.drag = 1;
rigid.constraints = RigidbodyConstraints2D.None;
}
public override void shot() {
if (Time.time - lastHit < 1) {
return;
}
health--;
if (isDead) {
if (Explosion != null)
Instantiate(Explosion, transform.position, transform.rotation);
Destroy(this.gameObject, 0.1f);
}
if (health <= 0) {
isDead = true;
setDead();
health = 0;
}
healthMat.material.color = healthColor[3-health];
lastHit = Time.time;
}
}

+ 49
- 0
singleTap/SingleTap/Assets/Scripts/SparkParticles.cs View File

@ -0,0 +1,49 @@
using UnityEngine;
using System.Collections;
public class SparkParticles : MonoBehaviour
{
public Transform BillboardTarget;
ParticleSystem _particleSystem;
// There is a fixed buffer size for particles hacked into this script.
// This means the script will cap the max number of particles to whatever the length of this array is.
// It's ugly I know. Sorry!
ParticleSystem.Particle[] _particles = new ParticleSystem.Particle[25];
void Awake()
{
_particleSystem = GetComponent<ParticleSystem>();
if (BillboardTarget == null)
BillboardTarget = Camera.main.transform;
}
void FixParticleRotations()
{
int count = _particleSystem.GetParticles(_particles);
for (int i = 0; i < count; i++)
{
Vector3 dir = _particles[i].velocity.normalized;
float rot = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
_particles[i].rotation = rot;
}
_particleSystem.SetParticles(_particles, _particleSystem.particleCount);
}
public void Play()
{
transform.LookAt(BillboardTarget);
_particleSystem.Play();
StartCoroutine(LateFix());
}
// It seems setting the rotations on the frame you tell the system to Play is insufficient.
// So this handy coroutine delays that by a single frame.
IEnumerator LateFix()
{
yield return null;
FixParticleRotations();
}
}

+ 12
- 0
singleTap/SingleTap/Assets/Scripts/SparkParticles.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a8609380967377848a5bdf3c1f9e19ac
timeCreated: 1459360624
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 4
- 4
singleTap/SingleTap/Assets/Scripts/TapDetector.cs View File

@ -43,12 +43,12 @@ public class TapDetector : MonoBehaviour {
private void longPressDown() {
Debug.Log("longPressDown");
//Debug.Log("longPressDown");
//playerScript.linkHook();
}
private void longPress() {
Debug.Log("holdingKey");
//Debug.Log("holdingKey");
Debug.DrawRay(transform.position, Vector3.up * 20, Color.red);
playerScript.rotatePlayer();
@ -56,13 +56,13 @@ public class TapDetector : MonoBehaviour {
}
private void longPressUp() {
Debug.Log("LongPressUp");
//Debug.Log("LongPressUp");
//playerScript.unlinkHook();
playerScript.movePlayer();
}
private void shortPress() {
Debug.Log("shorPress");
//Debug.Log("shorPress");
Debug.DrawRay(transform.position, Vector3.up * 20, Color.green,0.3f);
playerScript.shoot();

+ 9
- 0
singleTap/SingleTap/Assets/Shaders.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d7c85864f881a3448b4988f3f2c65edc
folderAsset: yes
timeCreated: 1471484757
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 81
- 0
singleTap/SingleTap/Assets/Shaders/BackGroundEffect.shader View File

@ -0,0 +1,81 @@
// Shader created with Shader Forge v1.26
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
// Note: Manually altering this data may prevent you from opening it in Shader Forge
/*SF_DATA;ver:1.26;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:9361,x:33209,y:32712,varname:node_9361,prsc:2|custl-6614-OUT;n:type:ShaderForge.SFN_Color,id:2943,x:32587,y:32901,ptovrint:False,ptlb:HighLight,ptin:_HighLight,varname:_HighLight,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.3602941,c2:0.3602941,c3:0.3602941,c4:1;n:type:ShaderForge.SFN_Color,id:5129,x:32576,y:32684,ptovrint:False,ptlb:LowLight,ptin:_LowLight,varname:_LowLight,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.7132353,c2:0.7132353,c3:0.7132353,c4:1;n:type:ShaderForge.SFN_Lerp,id:6614,x:32890,y:32938,varname:node_6614,prsc:2|A-5129-RGB,B-2943-RGB,T-1023-OUT;n:type:ShaderForge.SFN_Tex2d,id:7481,x:31875,y:33749,ptovrint:False,ptlb:GradienceMap,ptin:_GradienceMap,varname:_Gradience,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,tex:cb89da7e1100944499f9783f8a750859,ntxv:0,isnm:False|UVIN-2380-UVOUT;n:type:ShaderForge.SFN_TexCoord,id:2380,x:31564,y:33766,varname:node_2380,prsc:2,uv:0;n:type:ShaderForge.SFN_Add,id:4392,x:32094,y:33110,varname:node_4392,prsc:2|A-4708-OUT,B-8125-OUT;n:type:ShaderForge.SFN_Lerp,id:8125,x:31852,y:33157,varname:node_8125,prsc:2|A-8573-RGB,B-714-OUT,T-288-OUT;n:type:ShaderForge.SFN_RemapRange,id:714,x:31618,y:33221,varname:node_714,prsc:2,frmn:0,frmx:1,tomn:1,tomx:0|IN-8573-RGB;n:type:ShaderForge.SFN_Tex2d,id:8573,x:31147,y:33174,ptovrint:False,ptlb:TimeMap,ptin:_TimeMap,varname:_TimeNode,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,tex:b8f1d2aab7a1ed0478705fbbbbffde97,ntxv:0,isnm:False|UVIN-1982-UVOUT;n:type:ShaderForge.SFN_TexCoord,id:1982,x:30920,y:33087,varname:node_1982,prsc:2,uv:0;n:type:ShaderForge.SFN_ComponentMask,id:4482,x:32305,y:33086,varname:node_4482,prsc:2,cc1:0,cc2:-1,cc3:-1,cc4:-1|IN-4392-OUT;n:type:ShaderForge.SFN_Code,id:1023,x:32714,y:33346,varname:node_1023,prsc:2,code:IABmAGwAbwBhAHQAIAByAGUAdABWAGEAbAA7AA0ACgAgACAAIAAgACAAIAAgACAAIAAgAA0ACgAgAGYAbABvAGEAdAAgAHQAIAA9ACAAKAAoAEkAbgBwAHUAdAAgACsAIABTAGwAaQBkAGUAcgApAC8AKAAyACoAUwBsAGkAZABlAHIAKQApADsADQAKACAAcgBlAHQAVgBhAGwAIAA9ACAAbABlAHIAcAAgACgAMAAsADEALAB0ACkAOwANAAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAADQAKACAAcgBlAHQAdQByAG4AIABjAGwAYQBtAHAAIAAoAHIAZQB0AFYAYQBsACwAIAAwAC4AMAAsACAAMQAuADAAKQA7AA==,output:0,fname:CieltoGrad,width:384,height:187,input:0,input:0,input_1_label:Input,input_2_label:Slider|A-5345-OUT,B-3076-OUT;n:type:ShaderForge.SFN_Slider,id:4708,x:31020,y:32871,ptovrint:False,ptlb:TimeNode,ptin:_TimeNode,varname:node_4708,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:-1,cur:-0.6582282,max:1;n:type:ShaderForge.SFN_ToggleProperty,id:288,x:31690,y:33410,ptovrint:False,ptlb:InvertMap,ptin:_InvertMap,varname:node_288,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,on:True;n:type:ShaderForge.SFN_Clamp01,id:5345,x:32503,y:33211,varname:node_5345,prsc:2|IN-4482-OUT;n:type:ShaderForge.SFN_Clamp01,id:5374,x:32066,y:33749,varname:node_5374,prsc:2|IN-7481-R;n:type:ShaderForge.SFN_RemapRange,id:3076,x:32297,y:33684,varname:node_3076,prsc:2,frmn:0,frmx:1,tomn:0.001,tomx:1|IN-5374-OUT;proporder:2943-5129-7481-8573-4708-288;pass:END;sub:END;*/
Shader "Shader Forge/BackGroundEffect" {
Properties {
_HighLight ("HighLight", Color) = (0.3602941,0.3602941,0.3602941,1)
_LowLight ("LowLight", Color) = (0.7132353,0.7132353,0.7132353,1)
_GradienceMap ("GradienceMap", 2D) = "white" {}
_TimeMap ("TimeMap", 2D) = "white" {}
_TimeNode ("TimeNode", Range(-1, 1)) = -0.6582282
[MaterialToggle] _InvertMap ("InvertMap", Float ) = 1
}
SubShader {
Tags {
"RenderType"="Opaque"
}
Pass {
Name "FORWARD"
Tags {
"LightMode"="ForwardBase"
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define UNITY_PASS_FORWARDBASE
#include "UnityCG.cginc"
#pragma multi_compile_fwdbase_fullshadows
#pragma multi_compile_fog
#pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2
#pragma target 3.0
uniform float4 _HighLight;
uniform float4 _LowLight;
uniform sampler2D _GradienceMap; uniform float4 _GradienceMap_ST;
uniform sampler2D _TimeMap; uniform float4 _TimeMap_ST;
float CieltoGrad( float Input , float Slider ){
float retVal;
float t = ((Input + Slider)/(2*Slider));
retVal = lerp (0,1,t);
return clamp (retVal, 0.0, 1.0);
}
uniform float _TimeNode;
uniform fixed _InvertMap;
struct VertexInput {
float4 vertex : POSITION;
float2 texcoord0 : TEXCOORD0;
};
struct VertexOutput {
float4 pos : SV_POSITION;
float2 uv0 : TEXCOORD0;
UNITY_FOG_COORDS(1)
};
VertexOutput vert (VertexInput v) {
VertexOutput o = (VertexOutput)0;
o.uv0 = v.texcoord0;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
UNITY_TRANSFER_FOG(o,o.pos);
return o;
}
float4 frag(VertexOutput i) : COLOR {
////// Lighting:
float4 _TimeMap_var = tex2D(_TimeMap,TRANSFORM_TEX(i.uv0, _TimeMap));
float node_5345 = saturate((_TimeNode+lerp(_TimeMap_var.rgb,(_TimeMap_var.rgb*-1.0+1.0),_InvertMap)).r);
float4 _GradienceMap_var = tex2D(_GradienceMap,TRANSFORM_TEX(i.uv0, _GradienceMap));
float3 finalColor = lerp(_LowLight.rgb,_HighLight.rgb,CieltoGrad( node_5345 , (saturate(_GradienceMap_var.r)*0.999+0.001) ));
fixed4 finalRGBA = fixed4(finalColor,1);
UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
return finalRGBA;
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "ShaderForgeMaterialInspector"
}

+ 9
- 0
singleTap/SingleTap/Assets/Shaders/BackGroundEffect.shader.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f7bc2d33fe19cc54997cc96bab239558
timeCreated: 1471477635
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

+ 9
- 0
singleTap/SingleTap/Assets/Textures.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5620e7f621492d342bb3bd8371fb639a
folderAsset: yes
timeCreated: 1471484749
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/Textures/ConeGradience.png View File

Before After
Width: 1920  |  Height: 1080  |  Size: 1.2 MiB

+ 57
- 0
singleTap/SingleTap/Assets/Textures/ConeGradience.png.meta View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 1d3a9e5905874be40848a8e599ccf78f
timeCreated: 1471477641
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/Textures/CubeNoise.jpg View File

Before After
Width: 512  |  Height: 512  |  Size: 26 KiB

+ 57
- 0
singleTap/SingleTap/Assets/Textures/CubeNoise.jpg.meta View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: f1b1689e68f8ae24ebcaa24c1e8ca875
timeCreated: 1471477643
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
singleTap/SingleTap/Assets/_Scenes/TestScene.unity View File


Loading…
Cancel
Save