Commit fa2eb6d4 authored by Yuyang's avatar Yuyang

于:清理无用特效

parent f13a1a3a
fileFormatVersion: 2
guid: 2843a68919ef9104786a337d177d978f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: cbc4b8fc043d85d4ea8c6fc2b806a38f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0cc06b746c5c62647a683a0a22908818
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: 233dba8c036a4e248adb948dd7799586
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: fa3541d2232453c42af2f282742fcdc0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: 8816e7c08fa9327409139087b8e51c15
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%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: em_Dead
m_Shader: {fileID: 4800000, guid: 32270e56bfe6bd04ebc3220e7d98b980, type: 3}
m_ShaderKeywords: _ALPHABLEND_ON
m_LightmapFlags: 0
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 4a0778e1bb34a9e41983188d023352dd, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ColorMode: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 10
- _EmissionEnabled: 0
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _LightingEnabled: 0
- _Metallic: 0
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1.0592737, g: 1.0592737, b: 1.0592737, a: 1}
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
fileFormatVersion: 2
guid: 03deb9752e70c3c4b8b58fc57129087f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%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: em_Goodjop
m_Shader: {fileID: 4800000, guid: 32270e56bfe6bd04ebc3220e7d98b980, type: 3}
m_ShaderKeywords: _ALPHABLEND_ON
m_LightmapFlags: 0
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 3a1cf5bfbf19f3f47baebec670820b7f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ColorMode: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 10
- _EmissionEnabled: 0
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _LightingEnabled: 0
- _Metallic: 0
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1.0592737, g: 1.0592737, b: 1.0592737, a: 1}
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
fileFormatVersion: 2
guid: f79cdcccf5ee8884cbcb9e5e616eb9f6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%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: em_Help
m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- ALWAYS
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 065637bed16fc4e43a8d5e67bdfe5cab, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ColorMode: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 10
- _EmissionEnabled: 0
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _LightingEnabled: 0
- _Metallic: 0
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 2, g: 2, b: 2, a: 1}
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
fileFormatVersion: 2
guid: bcce570a109711d468438170f2432300
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9a697b80f2eaf3e43ad65b92c7db22a1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 157366c0e0827ff47b7669ae61c4513b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b4a5f95fbe0a39f4495177714968a107
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
namespace EpicToonFX
{
public class ETFXButtonScript : MonoBehaviour
{
public GameObject Button;
Text MyButtonText;
string projectileParticleName; // The variable to update the text component of the button
ETFXFireProjectile effectScript; // A variable used to access the list of projectiles
ETFXProjectileScript projectileScript;
public float buttonsX;
public float buttonsY;
public float buttonsSizeX;
public float buttonsSizeY;
public float buttonsDistance;
void Start ()
{
effectScript = GameObject.Find("ETFXFireProjectile").GetComponent<ETFXFireProjectile>();
getProjectileNames();
MyButtonText = Button.transform.Find("Text").GetComponent<Text>();
MyButtonText.text = projectileParticleName;
}
void Update ()
{
MyButtonText.text = projectileParticleName;
// print(projectileParticleName);
}
public void getProjectileNames() // Find and diplay the name of the currently selected projectile
{
// Access the currently selected projectile's 'ProjectileScript'
projectileScript = effectScript.projectiles[effectScript.currentProjectile].GetComponent<ETFXProjectileScript>();
projectileParticleName = projectileScript.projectileParticle.name; // Assign the name of the currently selected projectile to projectileParticleName
}
public bool overButton() // This function will return either true or false
{
Rect button1 = new Rect(buttonsX, buttonsY, buttonsSizeX, buttonsSizeY);
Rect button2 = new Rect(buttonsX + buttonsDistance, buttonsY, buttonsSizeX, buttonsSizeY);
if(button1.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)) ||
button2.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
{
return true;
}
else
return false;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 20f8572b34f163644821787ce4450d60
timeCreated: 1498765306
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.EventSystems;
using System.Collections;
namespace EpicToonFX
{
public class ETFXFireProjectile : MonoBehaviour
{
[SerializeField]
public GameObject[] projectiles;
[Header("Missile spawns at attached game object")]
public Transform spawnPosition;
[HideInInspector]
public int currentProjectile = 0;
public float speed = 500;
// MyGUI _GUI;
ETFXButtonScript selectedProjectileButton;
void Start()
{
selectedProjectileButton = GameObject.Find("Button").GetComponent<ETFXButtonScript>();
}
RaycastHit hit;
void Update()
{
if (Input.GetKeyDown(KeyCode.RightArrow))
{
nextEffect();
}
if (Input.GetKeyDown(KeyCode.D))
{
nextEffect();
}
if (Input.GetKeyDown(KeyCode.A))
{
previousEffect();
}
else if (Input.GetKeyDown(KeyCode.LeftArrow))
{
previousEffect();
}
if (Input.GetKeyDown(KeyCode.Mouse0)) //On left mouse down-click
{
if (!EventSystem.current.IsPointerOverGameObject()) //Checks if the mouse is not over a UI part
{
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100f)) //Finds the point where you click with the mouse
{
GameObject projectile = Instantiate(projectiles[currentProjectile], spawnPosition.position, Quaternion.identity) as GameObject; //Spawns the selected projectile
projectile.transform.LookAt(hit.point); //Sets the projectiles rotation to look at the point clicked
projectile.GetComponent<Rigidbody>().AddForce(projectile.transform.forward * speed); //Set the speed of the projectile by applying force to the rigidbody
}
}
}
Debug.DrawRay(Camera.main.ScreenPointToRay(Input.mousePosition).origin, Camera.main.ScreenPointToRay(Input.mousePosition).direction * 100, Color.yellow);
}
public void nextEffect() //Changes the selected projectile to the next. Used by UI
{
if (currentProjectile < projectiles.Length - 1)
currentProjectile++;
else
currentProjectile = 0;
selectedProjectileButton.getProjectileNames();
}
public void previousEffect() //Changes selected projectile to the previous. Used by UI
{
if (currentProjectile > 0)
currentProjectile--;
else
currentProjectile = projectiles.Length - 1;
selectedProjectileButton.getProjectileNames();
}
public void AdjustSpeed(float newSpeed) //Used by UI to set projectile speed
{
speed = newSpeed;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9ccaaa7728d800946bf8d084ae03e400
timeCreated: 1498765306
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace EpicToonFX
{
public class ETFXLoopScript : MonoBehaviour
{
public GameObject chosenEffect;
public float loopTimeLimit = 2.0f;
[Header("Spawn without")]
public bool spawnWithoutLight = true;
public bool spawnWithoutSound = true;
void Start ()
{
PlayEffect();
}
public void PlayEffect()
{
StartCoroutine("EffectLoop");
}
IEnumerator EffectLoop()
{
GameObject effectPlayer = (GameObject) Instantiate(chosenEffect, transform.position, transform.rotation);
if(spawnWithoutLight = true && effectPlayer.GetComponent<Light>())
{
effectPlayer.GetComponent<Light>().enabled = false;
//Destroy(gameObject.GetComponent<Light>());
}
if(spawnWithoutSound = true && effectPlayer.GetComponent<AudioSource>())
{
effectPlayer.GetComponent<AudioSource>().enabled = false;
//Destroy(gameObject.GetComponent<AudioSource>());
}
yield return new WaitForSeconds(loopTimeLimit);
Destroy (effectPlayer);
PlayEffect();
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 69093af5dcdce7b4ab5bbf82d06dbdb4
timeCreated: 1494265210
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace EpicToonFX
{
public class ETFXMouseOrbit : MonoBehaviour
{
public Transform target;
public float distance = 5.0f;
public float xSpeed = 120.0f;
public float ySpeed = 120.0f;
public float yMinLimit = -20f;
public float yMaxLimit = 80f;
public float distanceMin = .5f;
public float distanceMax = 15f;
public float smoothTime = 2f;
float rotationYAxis = 0.0f;
float rotationXAxis = 0.0f;
float velocityX = 0.0f;
float velocityY = 0.0f;
// Use this for initialization
void Start()
{
Vector3 angles = transform.eulerAngles;
rotationYAxis = angles.y;
rotationXAxis = angles.x;
// Make the rigid body not change rotation
if (GetComponent<Rigidbody>())
{
GetComponent<Rigidbody>().freezeRotation = true;
}
}
void LateUpdate()
{
if (target)
{
if (Input.GetMouseButton(1))
{
velocityX += xSpeed * Input.GetAxis("Mouse X") * distance * 0.02f;
velocityY += ySpeed * Input.GetAxis("Mouse Y") * 0.02f;
}
rotationYAxis += velocityX;
rotationXAxis -= velocityY;
rotationXAxis = ClampAngle(rotationXAxis, yMinLimit, yMaxLimit);
//Quaternion fromRotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, 0);
Quaternion toRotation = Quaternion.Euler(rotationXAxis, rotationYAxis, 0);
Quaternion rotation = toRotation;
distance = Mathf.Clamp(distance - Input.GetAxis("Mouse ScrollWheel") * 5, distanceMin, distanceMax);
RaycastHit hit;
if (Physics.Linecast(target.position, transform.position, out hit))
{
distance -= hit.distance;
}
Vector3 negDistance = new Vector3(0.0f, 0.0f, -distance);
Vector3 position = rotation * negDistance + target.position;
transform.rotation = rotation;
transform.position = position;
velocityX = Mathf.Lerp(velocityX, 0, Time.deltaTime * smoothTime);
velocityY = Mathf.Lerp(velocityY, 0, Time.deltaTime * smoothTime);
}
}
public static float ClampAngle(float angle, float min, float max)
{
if (angle < -360F)
angle += 360F;
if (angle > 360F)
angle -= 360F;
return Mathf.Clamp(angle, min, max);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9ca5afe5c4377094597336e19503f797
timeCreated: 1494196995
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class ETFXProjectileScript : MonoBehaviour
{
public GameObject impactParticle; // Effect spawned when projectile hits a collider
public GameObject projectileParticle; // Effect attached to the gameobject as child
public GameObject muzzleParticle; // Effect instantly spawned when gameobject is spawned
[Header("Adjust if not using Sphere Collider")]
public float colliderRadius = 1f;
[Range(0f, 1f)] // This is an offset that moves the impact effect slightly away from the point of impact to reduce clipping of the impact effect
public float collideOffset = 0.15f;
void Start()
{
projectileParticle = Instantiate(projectileParticle, transform.position, transform.rotation) as GameObject;
projectileParticle.transform.parent = transform;
if (muzzleParticle)
{
muzzleParticle = Instantiate(muzzleParticle, transform.position, transform.rotation) as GameObject;
Destroy(muzzleParticle, 1.5f); // 2nd parameter is lifetime of effect in seconds
}
}
void FixedUpdate()
{
if (GetComponent<Rigidbody>().velocity.magnitude != 0)
{
transform.rotation = Quaternion.LookRotation(GetComponent<Rigidbody>().velocity); // Sets rotation to look at direction of movement
}
RaycastHit hit;
float radius; // Sets the radius of the collision detection
if (transform.GetComponent<SphereCollider>())
radius = transform.GetComponent<SphereCollider>().radius;
else
radius = colliderRadius;
Vector3 direction = transform.GetComponent<Rigidbody>().velocity; // Gets the direction of the projectile, used for collision detection
if (transform.GetComponent<Rigidbody>().useGravity)
direction += Physics.gravity * Time.deltaTime; // Accounts for gravity if enabled
direction = direction.normalized;
float detectionDistance = transform.GetComponent<Rigidbody>().velocity.magnitude * Time.deltaTime; // Distance of collision detection for this frame
if (Physics.SphereCast(transform.position, radius, direction, out hit, detectionDistance)) // Checks if collision will happen
{
transform.position = hit.point + (hit.normal * collideOffset); // Move projectile to point of collision
GameObject impactP = Instantiate(impactParticle, transform.position, Quaternion.FromToRotation(Vector3.up, hit.normal)) as GameObject; // Spawns impact effect
ParticleSystem[] trails = GetComponentsInChildren<ParticleSystem>(); // Gets a list of particle systems, as we need to detach the trails
//Component at [0] is that of the parent i.e. this object (if there is any)
for (int i = 1; i < trails.Length; i++) // Loop to cycle through found particle systems
{
ParticleSystem trail = trails[i];
if (trail.gameObject.name.Contains("Trail"))
{
trail.transform.SetParent(null); // Detaches the trail from the projectile
Destroy(trail.gameObject, 2f); // Removes the trail after seconds
}
}
Destroy(projectileParticle, 3f); // Removes particle effect after delay
Destroy(impactP, 3.5f); // Removes impact effect after delay
Destroy(gameObject); // Removes the projectile
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: acd27932048c3254597a02078fa2cb26
timeCreated: 1498765306
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
public class ETFXSceneManager : MonoBehaviour
{
public bool GUIHide = false;
public bool GUIHide2 = false;
public bool GUIHide3 = false;
public bool GUIHide4 = false;
public void LoadScene2DDemo() {
SceneManager.LoadScene ("etfx_2ddemo");
}
public void LoadSceneCards() {
SceneManager.LoadScene ("etfx_cards");
}
public void LoadSceneCombat() {
SceneManager.LoadScene ("etfx_combat");
}
public void LoadSceneDecals() {
SceneManager.LoadScene ("etfx_decals");
}
public void LoadSceneDecals2() {
SceneManager.LoadScene ("etfx_decals2");
}
public void LoadSceneEmojis() {
SceneManager.LoadScene ("etfx_emojis");
}
public void LoadSceneEmojis2() {
SceneManager.LoadScene ("etfx_emojis2");
}
public void LoadSceneExplosions() {
SceneManager.LoadScene ("etfx_explosions");
}
public void LoadSceneExplosions2() {
SceneManager.LoadScene ("etfx_explosions2");
}
public void LoadSceneFire() {
SceneManager.LoadScene ("etfx_fire");
}
public void LoadSceneFire2() {
SceneManager.LoadScene ("etfx_fire2");
}
public void LoadSceneFire3() {
SceneManager.LoadScene ("etfx_fire3");
}
public void LoadSceneFireworks() {
SceneManager.LoadScene ("etfx_fireworks");
}
public void LoadSceneFlares() {
SceneManager.LoadScene ("etfx_flares");
}
public void LoadSceneMagic() {
SceneManager.LoadScene ("etfx_magic");
}
public void LoadSceneMagic2() {
SceneManager.LoadScene ("etfx_magic2");
}
public void LoadSceneMagic3() {
SceneManager.LoadScene ("etfx_magic3");
}
public void LoadSceneMainDemo() {
SceneManager.LoadScene ("etfx_maindemo");
}
public void LoadSceneMissiles() {
SceneManager.LoadScene ("etfx_missiles");
}
public void LoadScenePortals() {
SceneManager.LoadScene ("etfx_portals");
}
public void LoadScenePortals2() {
SceneManager.LoadScene ("etfx_portals2");
}
public void LoadScenePowerups() {
SceneManager.LoadScene ("etfx_powerups");
}
public void LoadScenePowerups2() {
SceneManager.LoadScene ("etfx_powerups2");
}
public void LoadSceneSparkles() {
SceneManager.LoadScene ("etfx_sparkles");
}
public void LoadSceneSwordCombat() {
SceneManager.LoadScene ("etfx_swordcombat");
}
public void LoadSceneSwordCombat2() {
SceneManager.LoadScene ("etfx_swordcombat2");
}
public void LoadSceneMoney() {
SceneManager.LoadScene ("etfx_money");
}
public void LoadSceneHealing() {
SceneManager.LoadScene ("etfx_healing");
}
public void LoadSceneWind() {
SceneManager.LoadScene ("etfx_wind");
}
void Update ()
{
if(Input.GetKeyDown(KeyCode.L))
{
GUIHide = !GUIHide;
if (GUIHide)
{
GameObject.Find("CanvasSceneSelect").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("CanvasSceneSelect").GetComponent<Canvas> ().enabled = true;
}
}
if(Input.GetKeyDown(KeyCode.J))
{
GUIHide2 = !GUIHide2;
if (GUIHide2)
{
GameObject.Find("Canvas").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("Canvas").GetComponent<Canvas> ().enabled = true;
}
}
if(Input.GetKeyDown(KeyCode.H))
{
GUIHide3 = !GUIHide3;
if (GUIHide3)
{
GameObject.Find("ParticleSysDisplayCanvas").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("ParticleSysDisplayCanvas").GetComponent<Canvas> ().enabled = true;
}
}
if(Input.GetKeyDown(KeyCode.K))
{
GUIHide4 = !GUIHide4;
if (GUIHide3)
{
GameObject.Find("CanvasTips").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("CanvasTips").GetComponent<Canvas> ().enabled = true;
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 08babb817a4cfd443ac41b418ffd8387
timeCreated: 1494197047
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace EpicToonFX
{
public class ETFXTarget : MonoBehaviour
{
[Header("Effect shown on target hit")]
public GameObject hitParticle;
[Header("Effect shown on target respawn")]
public GameObject respawnParticle;
private Renderer targetRenderer;
private Collider targetCollider;
void Start()
{
targetRenderer = GetComponent<Renderer>();
targetCollider = GetComponent<Collider>();
}
void SpawnTarget()
{
targetRenderer.enabled = true; //Shows the target
targetCollider.enabled = true; //Enables the collider
GameObject respawnEffect = Instantiate(respawnParticle, transform.position, transform.rotation) as GameObject; //Spawns attached respawn effect
Destroy(respawnEffect, 3.5f); //Removes attached respawn effect after x seconds
}
void OnTriggerEnter(Collider col)
{
if (col.tag == "Missile") // If collider is tagged as missile
{
if (hitParticle)
{
//Debug.Log("Target hit!");
GameObject destructibleEffect = Instantiate(hitParticle, transform.position, transform.rotation) as GameObject; // Spawns attached hit effect
Destroy(destructibleEffect, 2f); // Removes hit effect after x seconds
targetRenderer.enabled = false; // Hides the target
targetCollider.enabled = false; // Disables target collider
StartCoroutine(Respawn()); // Sets timer for respawning the target
}
}
}
IEnumerator Respawn()
{
yield return new WaitForSeconds(3);
SpawnTarget();
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: cf5b82cbe2647f24c9f1b44ee43b95b1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 716e1bd7fae49d342ab5b5a69f5bfb5f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public enum ButtonTypes {
NotDefined,
Previous,
Next
}
public class PEButtonScript : MonoBehaviour, IEventSystemHandler, IPointerEnterHandler, IPointerExitHandler {
#pragma warning disable 414
private Button myButton;
#pragma warning disable 414
public ButtonTypes ButtonType = ButtonTypes.NotDefined;
// Use this for initialization
void Start () {
myButton = gameObject.GetComponent<Button> ();
}
public void OnPointerEnter(PointerEventData eventData) {
// Used for Tooltip
UICanvasManager.GlobalAccess.MouseOverButton = true;
UICanvasManager.GlobalAccess.UpdateToolTip (ButtonType);
}
public void OnPointerExit(PointerEventData eventData) {
// Used for Tooltip
UICanvasManager.GlobalAccess.MouseOverButton = false;
UICanvasManager.GlobalAccess.ClearToolTip ();
}
public void OnButtonClicked () {
// Button Click Actions
UICanvasManager.GlobalAccess.UIButtonClick(ButtonType);
}
}
fileFormatVersion: 2
guid: 4eed3eee8b1748946ab71bf4a26ce94c
timeCreated: 1454422495
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ParticleEffectsLibrary : MonoBehaviour {
public static ParticleEffectsLibrary GlobalAccess;
void Awake () {
GlobalAccess = this;
currentActivePEList = new List<Transform> ();
TotalEffects = ParticleEffectPrefabs.Length;
CurrentParticleEffectNum = 1;
// Warn About Lengths of Arrays not matching
if (ParticleEffectSpawnOffsets.Length != TotalEffects) {
Debug.LogError ("ParticleEffectsLibrary-ParticleEffectSpawnOffset: Not all arrays match length, double check counts.");
}
if (ParticleEffectPrefabs.Length != TotalEffects) {
Debug.LogError ("ParticleEffectsLibrary-ParticleEffectPrefabs: Not all arrays match length, double check counts.");
}
// Setup Starting PE Name String
effectNameString = ParticleEffectPrefabs [CurrentParticleEffectIndex].name + " (" + CurrentParticleEffectNum.ToString() + " of " + TotalEffects.ToString() + ")";
}
// Stores total number of effects in arrays - NOTE: All Arrays must match length.
public int TotalEffects = 0;
public int CurrentParticleEffectIndex = 0;
public int CurrentParticleEffectNum = 0;
// public string[] ParticleEffectDisplayNames;
public Vector3[] ParticleEffectSpawnOffsets;
// How long until Particle Effect is Destroyed - 0 = never
public float[] ParticleEffectLifetimes;
public GameObject[] ParticleEffectPrefabs;
// Storing for deleting if looping particle effect
#pragma warning disable 414
private string effectNameString = "";
#pragma warning disable 414
private List<Transform> currentActivePEList;
void Start () {
}
public string GetCurrentPENameString() {
return ParticleEffectPrefabs [CurrentParticleEffectIndex].name + " (" + CurrentParticleEffectNum.ToString() + " of " + TotalEffects.ToString() + ")";
}
public void PreviousParticleEffect() {
// Destroy Looping Particle Effects
if (ParticleEffectLifetimes [CurrentParticleEffectIndex] == 0) {
if (currentActivePEList.Count > 0) {
for (int i = 0; i < currentActivePEList.Count; i++) {
if (currentActivePEList [i] != null) {
Destroy (currentActivePEList [i].gameObject);
}
}
currentActivePEList.Clear ();
}
}
// Select Previous Particle Effect
if (CurrentParticleEffectIndex > 0) {
CurrentParticleEffectIndex -= 1;
} else {
CurrentParticleEffectIndex = TotalEffects - 1;
}
CurrentParticleEffectNum = CurrentParticleEffectIndex + 1;
// Update PE Name String
effectNameString = ParticleEffectPrefabs [CurrentParticleEffectIndex].name + " (" + CurrentParticleEffectNum.ToString() + " of " + TotalEffects.ToString() + ")";
}
public void NextParticleEffect() {
// Destroy Looping Particle Effects
if (ParticleEffectLifetimes [CurrentParticleEffectIndex] == 0) {
if (currentActivePEList.Count > 0) {
for (int i = 0; i < currentActivePEList.Count; i++) {
if (currentActivePEList [i] != null) {
Destroy (currentActivePEList [i].gameObject);
}
}
currentActivePEList.Clear ();
}
}
// Select Next Particle Effect
if (CurrentParticleEffectIndex < TotalEffects - 1) {
CurrentParticleEffectIndex += 1;
} else {
CurrentParticleEffectIndex = 0;
}
CurrentParticleEffectNum = CurrentParticleEffectIndex + 1;
// Update PE Name String
effectNameString = ParticleEffectPrefabs [CurrentParticleEffectIndex].name + " (" + CurrentParticleEffectNum.ToString() + " of " + TotalEffects.ToString() + ")";
}
private Vector3 spawnPosition = Vector3.zero;
public void SpawnParticleEffect(Vector3 positionInWorldToSpawn) {
// Spawn Currently Selected Particle Effect
spawnPosition = positionInWorldToSpawn + ParticleEffectSpawnOffsets[CurrentParticleEffectIndex];
GameObject newParticleEffect = GameObject.Instantiate(ParticleEffectPrefabs[CurrentParticleEffectIndex], spawnPosition, ParticleEffectPrefabs[CurrentParticleEffectIndex].transform.rotation) as GameObject;
newParticleEffect.name = "PE_" + ParticleEffectPrefabs[CurrentParticleEffectIndex];
// Store Looping Particle Effects Systems
if (ParticleEffectLifetimes [CurrentParticleEffectIndex] == 0) {
currentActivePEList.Add (newParticleEffect.transform);
}
currentActivePEList.Add(newParticleEffect.transform);
// Destroy Particle Effect After Lifetime expired
if (ParticleEffectLifetimes [CurrentParticleEffectIndex] != 0) {
Destroy(newParticleEffect, ParticleEffectLifetimes[CurrentParticleEffectIndex]);
}
}
}
fileFormatVersion: 2
guid: 1a383f6b4f1b4ec4a9288e14968803f9
timeCreated: 1454421017
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UICanvasManager : MonoBehaviour {
public static UICanvasManager GlobalAccess;
void Awake () {
GlobalAccess = this;
}
public bool MouseOverButton = false;
public Text PENameText;
public Text ToolTipText;
// Use this for initialization
void Start () {
if (PENameText != null)
PENameText.text = ParticleEffectsLibrary.GlobalAccess.GetCurrentPENameString();
}
// Update is called once per frame
void Update () {
// Mouse Click - Check if mouse over button to prevent spawning particle effects while hovering or using UI buttons.
if (!MouseOverButton) {
// Left Button Click
if (Input.GetMouseButtonUp (0)) {
// Spawn Currently Selected Particle System
SpawnCurrentParticleEffect();
}
}
if (Input.GetKeyUp (KeyCode.A)) {
SelectPreviousPE ();
}
if (Input.GetKeyUp (KeyCode.D)) {
SelectNextPE ();
}
}
public void UpdateToolTip(ButtonTypes toolTipType) {
if (ToolTipText != null) {
if (toolTipType == ButtonTypes.Previous) {
ToolTipText.text = "Select Previous Particle Effect";
}
else if (toolTipType == ButtonTypes.Next) {
ToolTipText.text = "Select Next Particle Effect";
}
}
}
public void ClearToolTip() {
if (ToolTipText != null) {
ToolTipText.text = "";
}
}
private void SelectPreviousPE() {
// Previous
ParticleEffectsLibrary.GlobalAccess.PreviousParticleEffect();
if (PENameText != null)
PENameText.text = ParticleEffectsLibrary.GlobalAccess.GetCurrentPENameString();
}
private void SelectNextPE() {
// Next
ParticleEffectsLibrary.GlobalAccess.NextParticleEffect();
if (PENameText != null)
PENameText.text = ParticleEffectsLibrary.GlobalAccess.GetCurrentPENameString();
}
private RaycastHit rayHit;
private void SpawnCurrentParticleEffect() {
// Spawn Particle Effect
Ray mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast (mouseRay, out rayHit)) {
ParticleEffectsLibrary.GlobalAccess.SpawnParticleEffect (rayHit.point);
}
}
/// <summary>
/// User interfaces the button click.
/// </summary>
/// <param name="buttonTypeClicked">Button type clicked.</param>
public void UIButtonClick(ButtonTypes buttonTypeClicked) {
switch (buttonTypeClicked) {
case ButtonTypes.Previous:
// Select Previous Prefab
SelectPreviousPE();
break;
case ButtonTypes.Next:
// Select Next Prefab
SelectNextPE();
break;
default:
// Nothing
break;
}
}
}
fileFormatVersion: 2
guid: 678219500b099a742ab7e7957116755c
timeCreated: 1454420980
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f4e243c04ac2b34448a46221018f6d24
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace EpicToonFX
{
public class ETFXLightFade : MonoBehaviour
{
[Header("Seconds to dim the light")]
public float life = 0.2f;
public bool killAfterLife = true;
private Light li;
private float initIntensity;
// Use this for initialization
void Start()
{
if (gameObject.GetComponent<Light>())
{
li = gameObject.GetComponent<Light>();
initIntensity = li.intensity;
}
else
print("No light object found on " + gameObject.name);
}
// Update is called once per frame
void Update()
{
if (gameObject.GetComponent<Light>())
{
li.intensity -= initIntensity * (Time.deltaTime / life);
if (killAfterLife && li.intensity <= 0)
//Destroy(gameObject);
Destroy(gameObject.GetComponent<Light>());
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 2f54e17d705a2894d88787e24190ebfa
timeCreated: 1499439792
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace EpicToonFX
{
public class ETFXPitchRandomizer : MonoBehaviour
{
public float randomPercent = 10;
void Start ()
{
transform.GetComponent<AudioSource>().pitch *= 1 + Random.Range(-randomPercent / 100, randomPercent / 100);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 628ef9b0c7e4fd24db54868035e11237
timeCreated: 1499558257
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace EpicToonFX
{
public class ETFXRotation : MonoBehaviour
{
[Header("Rotate axises by degrees per second")]
public Vector3 rotateVector = Vector3.zero;
public enum spaceEnum { Local, World };
public spaceEnum rotateSpace;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (rotateSpace == spaceEnum.Local)
transform.Rotate(rotateVector * Time.deltaTime);
if (rotateSpace == spaceEnum.World)
transform.Rotate(rotateVector * Time.deltaTime, Space.World);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 7faa64a828219b44cb0eb5bfbfa83524
timeCreated: 1494264015
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e1af833cb2a7d7d419eb5377e60da6e7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 66f07b9d9dec61d43878190d10927ab3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 5e0e3bc40887aba408a6a8ee4715b0c5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace LowPolyWaterDemo {
public class DemoFreeFlyCamera : MonoBehaviour {
public bool lockCursor = false;
public float cameraSensitivity = 4;
public float normalMoveSpeed = 10;
public float smoothTime = 10f;
private float rotationX = 0.0f;
private float rotationY = 0.0f;
void Start() {
if (lockCursor) {
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}
void Update() {
var dt = Mathf.Clamp(Time.deltaTime, 0f, 0.03f);
rotationX += Input.GetAxis("Mouse X") * cameraSensitivity;
rotationY += Input.GetAxis("Mouse Y") * cameraSensitivity;
rotationY = Mathf.Clamp(rotationY, -90, 90);
if (rotationX > 360) rotationX -= 360f;
var locRot = Quaternion.AngleAxis(rotationX, Vector3.up);
locRot *= Quaternion.AngleAxis(rotationY, Vector3.left);
transform.localRotation = Quaternion.Slerp(transform.localRotation,
locRot, smoothTime * dt);
float speed = normalMoveSpeed * dt;
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
speed *= 4;
var deltaVertical = transform.forward;
var deltaHorizontal = transform.right;
if (Input.GetKey(KeyCode.Space)) { transform.position += Vector3.up * speed; }
if (Input.GetKey(KeyCode.E)) { transform.position -= Vector3.up * speed; }
transform.position += deltaVertical * speed * Input.GetAxis("Vertical");
transform.position += deltaHorizontal * speed * Input.GetAxis("Horizontal");
}
}
}
fileFormatVersion: 2
guid: 1fc03dc15133d4d4595e04b7c960e740
timeCreated: 1484900176
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3510ac28e72be244aac5334061541d32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
[CustomEditor(typeof(LowPolyWater))]
public class LowPolyWaterInspector : Editor {
private LowPolyWater _myScript;
// We need to use and to call an instnace of the default MaterialEditor
private MaterialEditor _materialEditor;
void OnEnable() {
_myScript = (LowPolyWater)target;
if (_myScript.material != null) {
// Create an instance of the default MaterialEditor
_materialEditor = (MaterialEditor)CreateEditor(_myScript.material);
}
}
public override void OnInspectorGUI() {
EditorGUI.BeginChangeCheck();
// Draw the material field of LowPolyWater
//EditorGUILayout.PropertyField(serializedObject.FindProperty("material"));
base.OnInspectorGUI();
if (EditorGUI.EndChangeCheck()) {
serializedObject.ApplyModifiedProperties();
if (_materialEditor != null) {
// Free the memory used by the previous MaterialEditor
DestroyImmediate(_materialEditor);
}
if (_myScript.material != null) {
// Create a new instance of the default MaterialEditor
_materialEditor = (MaterialEditor)CreateEditor(_myScript.material);
}
}
if (_materialEditor != null) {
// Draw the material's foldout and the material shader field
// Required to call _materialEditor.OnInspectorGUI ();
_materialEditor.DrawHeader();
// We need to prevent the user to edit Unity default materials
bool isDefaultMaterial = !AssetDatabase.GetAssetPath(_myScript.material).StartsWith("Assets");
using (new EditorGUI.DisabledGroupScope(isDefaultMaterial)) {
// Draw the material properties
// Works only if the foldout of _materialEditor.DrawHeader () is open
_materialEditor.OnInspectorGUI();
}
}
}
void OnDisable() {
if (_materialEditor != null) {
// Free the memory used by default MaterialEditor
DestroyImmediate(_materialEditor);
}
}
}
fileFormatVersion: 2
guid: 756e442b8e1d8f54ba00f0e6aac8fb54
timeCreated: 1482514736
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using UnityEditor;
using UnityEngine;
public class LowPolyWaterShaderGUI : ShaderGUI {
enum Shading { Flat, VertexLit, PixelLit};
MaterialProperty _Color = null;
MaterialProperty _Opacity = null;
MaterialProperty _Gloss = null;
MaterialProperty _Specular = null;
MaterialProperty _SpecColor = null;
MaterialProperty _Smoothness = null;
MaterialProperty _FresnelTex = null;
MaterialProperty _Shading = null;
MaterialProperty _Waves = null;
MaterialProperty _Length = null;
MaterialProperty _Stretch = null;
MaterialProperty _Speed = null;
MaterialProperty _Height = null;
MaterialProperty _Steepness = null;
MaterialProperty _Direction = null;
MaterialProperty _RSpeed = null;
MaterialProperty _RHeight = null;
MaterialProperty _EdgeBlend = null;
MaterialProperty _ShoreColor = null;
MaterialProperty _ShoreIntensity = null;
MaterialProperty _ShoreDistance = null;
MaterialProperty _NoiseTex = null;
MaterialProperty _ZWrite = null;
MaterialProperty __Direction = null;
MaterialProperty __Scale = null;
MaterialProperty __RHeight = null;
MaterialProperty __RSpeed = null;
MaterialProperty __TexSize = null;
MaterialProperty __Speed = null;
MaterialProperty __Height = null;
static readonly GUIContent fresnelLbl = new GUIContent("Fresnel (A)");
static readonly GUIContent noiseLbl = new GUIContent("Noise Texture (A)");
public void FindProperties(MaterialProperty[] props) {
_Color = FindProperty("_Color", props);
_Opacity = FindProperty("_Opacity", props);
_Gloss = FindProperty("_Gloss", props);
_Specular = FindProperty("_Specular", props);
_SpecColor = FindProperty("_SpecColor", props);
_Smoothness = FindProperty("_Smoothness", props);
_FresnelTex = FindProperty("_FresnelTex", props);
_Shading = FindProperty("_Shading", props);
_Waves = FindProperty("_Waves", props);
_Length = FindProperty("_Length", props);
_Stretch = FindProperty("_Stretch", props);
_Speed = FindProperty("_Speed", props);
_Height = FindProperty("_Height", props);
_Steepness = FindProperty("_Steepness", props);
_Direction = FindProperty("_Direction", props);
_RSpeed = FindProperty("_RSpeed", props);
_RHeight = FindProperty("_RHeight", props);
_EdgeBlend = FindProperty("_EdgeBlend", props);
_ShoreColor = FindProperty("_ShoreColor", props);
_ShoreIntensity = FindProperty("_ShoreIntensity", props);
_ShoreDistance = FindProperty("_ShoreDistance", props);
_NoiseTex = FindProperty("_NoiseTex", props);
_ZWrite = FindProperty("_ZWrite", props);
__Direction = FindProperty("_Direction_", props);
__Scale = FindProperty("_Scale_", props);
__RHeight = FindProperty("_RHeight_", props);
__RSpeed = FindProperty("_RSpeed_", props);
__TexSize = FindProperty("_TexSize_", props);
__Speed = FindProperty("_Speed_", props);
__Height = FindProperty("_Height_", props);
}
const int space = 10;
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props) {
FindProperties(props);
materialEditor.SetDefaultGUIWidths();
materialEditor.UseDefaultMargins();
var scale = __Scale.floatValue;
GUILayout.Label("Lighting", EditorStyles.boldLabel);
materialEditor.ShaderProperty(_Color, _Color.displayName);
materialEditor.ShaderProperty(_Opacity, _Opacity.displayName);
materialEditor.ShaderProperty(_Gloss, _Gloss.displayName);
materialEditor.ShaderProperty(_Specular, _Specular.displayName);
materialEditor.ShaderProperty(_SpecColor, _SpecColor.displayName);
materialEditor.ShaderProperty(_Smoothness, _Smoothness.displayName);
materialEditor.TexturePropertySingleLine(fresnelLbl, _FresnelTex);
EditorGUIUtility.labelWidth -= 30f;
materialEditor.ShaderProperty(_Shading, _Shading.displayName);
EditorGUIUtility.labelWidth += 30f;
GUILayout.Space(space);
GUILayout.Label("Ripples", EditorStyles.boldLabel);
materialEditor.ShaderProperty(_RSpeed, _RSpeed.displayName);
materialEditor.ShaderProperty(_RHeight, _RHeight.displayName);
__RHeight.floatValue = _RHeight.floatValue * scale;
__RSpeed.floatValue = _RSpeed.floatValue * scale;
GUILayout.Space(space);
GUILayout.Label("Waves", EditorStyles.boldLabel);
EditorGUIUtility.labelWidth -= 30f;
materialEditor.ShaderProperty(_Waves, _Waves.displayName);
EditorGUIUtility.labelWidth += 30f;
EditorGUI.BeginDisabledGroup(_Waves.floatValue < .5f);
materialEditor.ShaderProperty(_Length, _Length.displayName);
materialEditor.ShaderProperty(_Stretch, _Stretch.displayName);
materialEditor.ShaderProperty(_Speed, _Speed.displayName);
materialEditor.ShaderProperty(_Height, _Height.displayName);
materialEditor.ShaderProperty(_Steepness, _Steepness.displayName);
materialEditor.ShaderProperty(_Direction, _Direction.displayName);
var steepness = _Steepness.floatValue * _Length.floatValue;
var angle = Mathf.Deg2Rad * _Direction.floatValue;
var cos = Mathf.Cos(angle);
var sin = Mathf.Sin(angle);
__Direction.vectorValue = new Vector4(cos, sin, cos * steepness, sin * steepness);
__Height.floatValue = _Height.floatValue * scale;
__Speed.floatValue = _Speed.floatValue * scale;
EditorGUI.EndDisabledGroup();
GUILayout.Space(space);
GUILayout.Label("Shore Blend", EditorStyles.boldLabel);
materialEditor.ShaderProperty(_EdgeBlend, _EdgeBlend.displayName);
EditorGUI.BeginDisabledGroup(_EdgeBlend.floatValue < .5f);
materialEditor.ShaderProperty(_ShoreColor, _ShoreColor.displayName);
materialEditor.ShaderProperty(_ShoreIntensity, _ShoreIntensity.displayName);
materialEditor.ShaderProperty(_ShoreDistance, _ShoreDistance.displayName);
EditorGUI.EndDisabledGroup();
GUILayout.Space(space);
GUILayout.Label("Other", EditorStyles.boldLabel);
materialEditor.TexturePropertySingleLine(noiseLbl, _NoiseTex);
if(_NoiseTex.textureValue!= null)
__TexSize.floatValue = _NoiseTex.textureValue.height * scale;
materialEditor.ShaderProperty(_ZWrite, _ZWrite.displayName);
//base.OnGUI(materialEditor, props);
}
}
fileFormatVersion: 2
guid: 44cb7c3351c1be245bbd5768cb548c68
timeCreated: 1482506991
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a91f11d18064ad148aa3cfd24707c208
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 21a83159f57c56a4d88442fb305cc955
timeCreated: 1481994008
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 20bd2b5b1b042e34cb01e9184e61e233
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Wobble : MonoBehaviour
{
Renderer rend;
Vector3 lastPos;
Vector3 velocity;
Vector3 lastRot;
Vector3 angularVelocity;
public float MaxWobble = 0.03f;
public float WobbleSpeed = 1f;
public float Recovery = 1f;
float wobbleAmountX;
float wobbleAmountZ;
float wobbleAmountToAddX;
float wobbleAmountToAddZ;
float pulse;
float time = 0.5f;
// Use this for initialization
void Start()
{
rend = GetComponent<Renderer>();
}
private void Update()
{
time += Time.deltaTime;
// decrease wobble over time
wobbleAmountToAddX = Mathf.Lerp(wobbleAmountToAddX, 0, Time.deltaTime * (Recovery));
wobbleAmountToAddZ = Mathf.Lerp(wobbleAmountToAddZ, 0, Time.deltaTime * (Recovery));
// make a sine wave of the decreasing wobble
pulse = 2 * Mathf.PI * WobbleSpeed;
wobbleAmountX = wobbleAmountToAddX * Mathf.Sin(pulse * time);
wobbleAmountZ = wobbleAmountToAddZ * Mathf.Sin(pulse * time);
// send it to the shader
rend.material.SetFloat("_WobbleX", wobbleAmountX);
rend.material.SetFloat("_WobbleZ", wobbleAmountZ);
// velocity
velocity = (lastPos - transform.position) / Time.deltaTime;
angularVelocity = transform.rotation.eulerAngles - lastRot;
// add clamped velocity to wobble
wobbleAmountToAddX += Mathf.Clamp((velocity.x + (angularVelocity.z * 0.2f)) * MaxWobble, -MaxWobble, MaxWobble);
wobbleAmountToAddZ += Mathf.Clamp((velocity.z + (angularVelocity.x * 0.2f)) * MaxWobble, -MaxWobble, MaxWobble);
// keep last position
lastPos = transform.position;
lastRot = transform.rotation.eulerAngles;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: dba4bfd00a89e064d898a67ab81e8ca7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 423a89f1cba5ad84aa53f4c98fdab59c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 499a55fa0112e1847914c7b9aae361e2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 54b7c08629ac7944ca9e46985ad53e46
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
namespace PolygonArsenal
{
public class PolygonButtonScript : MonoBehaviour
{
public GameObject Button;
Text MyButtonText;
string projectileParticleName; // The variable to update the text component of the button
PolygonFireProjectile effectScript; // A variable used to access the list of projectiles
PolygonProjectileScript projectileScript;
public float buttonsX;
public float buttonsY;
public float buttonsSizeX;
public float buttonsSizeY;
public float buttonsDistance;
void Start()
{
effectScript = GameObject.Find("PolygonFireProjectile").GetComponent<PolygonFireProjectile>(); // The FireProjectile script needs to be on a gameobject called FireProjectile, or else it won't be found
getProjectileNames();
MyButtonText = Button.transform.Find("Text").GetComponent<Text>();
MyButtonText.text = projectileParticleName;
}
void Update()
{
MyButtonText.text = projectileParticleName;
// print(projectileParticleName);
}
public void getProjectileNames() // Find and diplay the name of the currently selected projectile
{
projectileScript = effectScript.projectiles[effectScript.currentProjectile].GetComponent<PolygonProjectileScript>();// Access the currently selected projectile's 'ProjectileScript'
projectileParticleName = projectileScript.projectileParticle.name; // Assign the name of the currently selected projectile to projectileParticleName
}
public bool overButton() // This function will return either true or false
{
Rect button1 = new Rect(buttonsX, buttonsY, buttonsSizeX, buttonsSizeY);
Rect button2 = new Rect(buttonsX + buttonsDistance, buttonsY, buttonsSizeX, buttonsSizeY);
if (button1.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)) ||
button2.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
{
return true;
}
else
return false;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 0a14325ec4c536541b2a754406153fe7
timeCreated: 1508516918
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.EventSystems;
using System.Collections;
namespace PolygonArsenal
{
public class PolygonFireProjectile : MonoBehaviour
{
RaycastHit hit;
public GameObject[] projectiles;
public Transform spawnPosition;
[HideInInspector]
public int currentProjectile = 0;
public float speed = 1000;
// MyGUI _GUI;
PolygonButtonScript selectedProjectileButton;
void Start()
{
selectedProjectileButton = GameObject.Find("Button").GetComponent<PolygonButtonScript>();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.RightArrow))
{
nextEffect();
}
if (Input.GetKeyDown(KeyCode.D))
{
nextEffect();
}
if (Input.GetKeyDown(KeyCode.A))
{
previousEffect();
}
else if (Input.GetKeyDown(KeyCode.LeftArrow))
{
previousEffect();
}
if (Input.GetKeyDown(KeyCode.Mouse0))
{
if (!EventSystem.current.IsPointerOverGameObject())
{
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100f))
{
GameObject projectile = Instantiate(projectiles[currentProjectile], spawnPosition.position, Quaternion.identity) as GameObject;
projectile.transform.LookAt(hit.point);
projectile.GetComponent<Rigidbody>().AddForce(projectile.transform.forward * speed);
}
}
}
Debug.DrawRay(Camera.main.ScreenPointToRay(Input.mousePosition).origin, Camera.main.ScreenPointToRay(Input.mousePosition).direction * 100, Color.yellow);
}
public void nextEffect()
{
if (currentProjectile < projectiles.Length - 1)
currentProjectile++;
else
currentProjectile = 0;
selectedProjectileButton.getProjectileNames();
}
public void previousEffect()
{
if (currentProjectile > 0)
currentProjectile--;
else
currentProjectile = projectiles.Length - 1;
selectedProjectileButton.getProjectileNames();
}
public void AdjustSpeed(float newSpeed)
{
speed = newSpeed;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 82096b18a42c3a2468c199a9bf5ee1c2
timeCreated: 1508516994
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace PolygonArsenal
{
public class PolygonLoopScript : MonoBehaviour
{
public GameObject chosenEffect;
public float loopTimeLimit = 2.0f;
void Start()
{
PlayEffect();
}
public void PlayEffect()
{
StartCoroutine("EffectLoop");
}
IEnumerator EffectLoop()
{
//GameObject effectPlayer = (GameObject)Instantiate(chosenEffect, transform.position, transform.rotation);
GameObject effectPlayer = (GameObject)Instantiate(chosenEffect);
effectPlayer.transform.position = transform.position;
//effectPlayer.transform.rotation = Quaternion.Euler(new Vector3(0, 90, 0));
yield return new WaitForSeconds(loopTimeLimit);
Destroy(effectPlayer);
PlayEffect();
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 12eda49810402c344b42c34203ffdccc
timeCreated: 1508516972
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
[AddComponentMenu("Camera-Control/Mouse drag Orbit with zoom")]
public class PolygonOrbit : MonoBehaviour
{
public Transform target;
public float distance = 5.0f;
public float xSpeed = 120.0f;
public float ySpeed = 120.0f;
public float yMinLimit = -20f;
public float yMaxLimit = 80f;
public float distanceMin = .5f;
public float distanceMax = 15f;
public float smoothTime = 2f;
float rotationYAxis = 0.0f;
float rotationXAxis = 0.0f;
float velocityX = 0.0f;
float velocityY = 0.0f;
// Use this for initialization
void Start()
{
Vector3 angles = transform.eulerAngles;
rotationYAxis = angles.y;
rotationXAxis = angles.x;
// Make the rigid body not change rotation
if (GetComponent<Rigidbody>())
{
GetComponent<Rigidbody>().freezeRotation = true;
}
}
void LateUpdate()
{
if (target)
{
if (Input.GetMouseButton(1))
{
velocityX += xSpeed * Input.GetAxis("Mouse X") * distance * 0.02f;
velocityY += ySpeed * Input.GetAxis("Mouse Y") * 0.02f;
}
rotationYAxis += velocityX;
rotationXAxis -= velocityY;
rotationXAxis = ClampAngle(rotationXAxis, yMinLimit, yMaxLimit);
//Quaternion fromRotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, 0);
Quaternion toRotation = Quaternion.Euler(rotationXAxis, rotationYAxis, 0);
Quaternion rotation = toRotation;
distance = Mathf.Clamp(distance - Input.GetAxis("Mouse ScrollWheel") * 5, distanceMin, distanceMax);
RaycastHit hit;
if (Physics.Linecast(target.position, transform.position, out hit))
{
distance -= hit.distance;
}
Vector3 negDistance = new Vector3(0.0f, 0.0f, -distance);
Vector3 position = rotation * negDistance + target.position;
transform.rotation = rotation;
transform.position = position;
velocityX = Mathf.Lerp(velocityX, 0, Time.deltaTime * smoothTime);
velocityY = Mathf.Lerp(velocityY, 0, Time.deltaTime * smoothTime);
}
}
public static float ClampAngle(float angle, float min, float max)
{
if (angle < -360F)
angle += 360F;
if (angle > 360F)
angle -= 360F;
return Mathf.Clamp(angle, min, max);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 225f1b6c1a43124458cb013772dc26aa
timeCreated: 1508516906
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace PolygonArsenal
{
public class PolygonProjectileScript : MonoBehaviour
{
public GameObject impactParticle;
public GameObject projectileParticle;
public GameObject muzzleParticle;
public GameObject[] trailParticles;
[Header("Adjust if not using Sphere Collider")]
public float colliderRadius = 1f;
[Range(0f, 1f)]
public float collideOffset = 0.15f;
void Start()
{
projectileParticle = Instantiate(projectileParticle, transform.position, transform.rotation) as GameObject;
projectileParticle.transform.parent = transform;
if (muzzleParticle)
{
muzzleParticle = Instantiate(muzzleParticle, transform.position, transform.rotation) as GameObject;
Destroy(muzzleParticle, 1.5f); // Lifetime of muzzle effect.
}
}
void FixedUpdate()
{
RaycastHit hit;
float rad;
if (transform.GetComponent<SphereCollider>())
rad = transform.GetComponent<SphereCollider>().radius;
else
rad = colliderRadius;
Vector3 dir = transform.GetComponent<Rigidbody>().velocity;
if (transform.GetComponent<Rigidbody>().useGravity)
dir += Physics.gravity * Time.deltaTime;
dir = dir.normalized;
float dist = transform.GetComponent<Rigidbody>().velocity.magnitude * Time.deltaTime;
if (Physics.SphereCast(transform.position, rad, dir, out hit, dist))
{
transform.position = hit.point + (hit.normal * collideOffset);
GameObject impactP = Instantiate(impactParticle, transform.position, Quaternion.FromToRotation(Vector3.up, hit.normal)) as GameObject;
if (hit.transform.tag == "Destructible") // Projectile will destroy objects tagged as Destructible
{
Destroy(hit.transform.gameObject);
}
foreach (GameObject trail in trailParticles)
{
GameObject curTrail = transform.Find(projectileParticle.name + "/" + trail.name).gameObject;
curTrail.transform.parent = null;
Destroy(curTrail, 3f);
}
Destroy(projectileParticle, 3f);
Destroy(impactP, 3.5f);
Destroy(gameObject);
ParticleSystem[] trails = GetComponentsInChildren<ParticleSystem>();
//Component at [0] is that of the parent i.e. this object (if there is any)
for (int i = 1; i < trails.Length; i++)
{
ParticleSystem trail = trails[i];
if (trail.gameObject.name.Contains("Trail"))
{
trail.transform.SetParent(null);
Destroy(trail.gameObject, 2f);
}
}
}
}
//private bool hasCollided = false;
/*void OnCollisionEnter(Collision hit)
{
if (!hasCollided)
{
hasCollided = true;
impactParticle = Instantiate(impactParticle, transform.position, Quaternion.FromToRotation(Vector3.up, impactNormal)) as GameObject;
if (hit.gameObject.tag == "Destructible") // Projectile will destroy objects tagged as Destructible
{
Destroy(hit.gameObject);
}
foreach (GameObject trail in trailParticles)
{
GameObject curTrail = transform.Find(projectileParticle.name + "/" + trail.name).gameObject;
curTrail.transform.parent = null;
Destroy(curTrail, 3f);
}
Destroy(projectileParticle, 3f);
Destroy(impactParticle, 5f);
Destroy(gameObject);
ParticleSystem[] trails = GetComponentsInChildren<ParticleSystem>();
//Component at [0] is that of the parent i.e. this object (if there is any)
for (int i = 1; i < trails.Length; i++)
{
ParticleSystem trail = trails[i];
if (trail.gameObject.name.Contains("Trail"))
{
trail.transform.SetParent(null);
Destroy(trail.gameObject, 2f);
}
}
}
}*/
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: c736e84d8f869d245b3d1dba36061db9
timeCreated: 1508516945
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Events;
namespace PolygonArsenal
{
public class PolygonSceneSelect : MonoBehaviour
{
public bool GUIHide = false;
public bool GUIHide2 = false;
public bool GUIHide3 = false;
public void LoadSceneDemoMissiles()
{
SceneManager.LoadScene("PolygonDemoMissiles");
}
public void LoadSceneDemo01()
{
SceneManager.LoadScene("PolygonDemo01");
}
public void LoadSceneDemo02()
{
SceneManager.LoadScene("PolygonDemo02");
}
public void LoadSceneDemo03()
{
SceneManager.LoadScene("PolygonDemo03");
}
public void LoadSceneDemo04()
{
SceneManager.LoadScene("PolygonDemo04");
}
public void LoadSceneDemo05()
{
SceneManager.LoadScene("PolygonDemo05");
}
public void LoadSceneDemo06()
{
SceneManager.LoadScene("PolygonDemo06");
}
public void LoadSceneDemo07()
{
SceneManager.LoadScene("PolygonDemo07");
}
public void LoadSceneDemo08()
{
SceneManager.LoadScene("PolygonDemo08");
}
public void LoadSceneDemo09()
{
SceneManager.LoadScene("PolygonDemo09");
}
public void LoadSceneDemo10()
{
SceneManager.LoadScene("PolygonDemo10");
}
public void LoadSceneDemo11()
{
SceneManager.LoadScene("PolygonDemo11");
}
public void LoadSceneDemo12()
{
SceneManager.LoadScene("PolygonDemo12");
}
public void LoadSceneDemo13()
{
SceneManager.LoadScene("PolygonDemo13");
}
public void LoadSceneDemo14()
{
SceneManager.LoadScene("PolygonDemo14");
}
public void LoadSceneDemo15()
{
SceneManager.LoadScene("PolygonDemo15");
}
public void LoadSceneDemo16()
{
SceneManager.LoadScene("PolygonDemo16");
}
public void LoadSceneDemo17()
{
SceneManager.LoadScene("PolygonDemo17");
}
public void LoadSceneDemo18()
{
SceneManager.LoadScene("PolygonDemo18");
}
void Update ()
{
if(Input.GetKeyDown(KeyCode.L))
{
GUIHide = !GUIHide;
if (GUIHide)
{
GameObject.Find("CanvasSceneSelect").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("CanvasSceneSelect").GetComponent<Canvas> ().enabled = true;
}
}
if(Input.GetKeyDown(KeyCode.J))
{
GUIHide2 = !GUIHide2;
if (GUIHide2)
{
GameObject.Find("CanvasMissiles").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("CanvasMissiles").GetComponent<Canvas> ().enabled = true;
}
}
if(Input.GetKeyDown(KeyCode.H))
{
GUIHide3 = !GUIHide3;
if (GUIHide3)
{
GameObject.Find("CanvasTips").GetComponent<Canvas> ().enabled = false;
}
else
{
GameObject.Find("CanvasTips").GetComponent<Canvas> ().enabled = true;
}
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 843947ef86e21b04597cfe2d21f2d819
timeCreated: 1508516959
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bf274ded6f3f77e4a95087eaba21824c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace PolygonArsenal
{
public class PolygonLightFade : MonoBehaviour
{
[Header("Seconds to dim the light")]
public float life = 0.2f;
public bool killAfterLife = true;
private Light li;
private float initIntensity;
// Use this for initialization
void Start()
{
if (gameObject.GetComponent<Light>())
{
li = gameObject.GetComponent<Light>();
initIntensity = li.intensity;
}
else
print("No light object found on " + gameObject.name);
}
// Update is called once per frame
void Update()
{
if (gameObject.GetComponent<Light>())
{
li.intensity -= initIntensity * (Time.deltaTime / life);
if (killAfterLife && li.intensity <= 0)
Destroy(gameObject);
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 52b907da54153884b95b31e930d046d2
timeCreated: 1509044237
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class PolygonLightFlicker : MonoBehaviour
{
// Properties
public string waveFunction = "sin"; // possible values: sin, tri(angle), sqr(square), saw(tooth), inv(verted sawtooth), noise (random)
public float startValue = 0.0f; // start
public float amplitude = 1.0f; // amplitude of the wave
public float phase = 0.0f; // start point inside on wave cycle
public float frequency = 0.5f; // cycle frequency per second
// Keep a copy of the original color
private Color originalColor;
// Store the original color
void Start (){
originalColor = GetComponent<Light>().color;
}
void Update (){
Light light = GetComponent<Light>();
light.color = originalColor * (EvalWave());
}
float EvalWave (){
float x = (Time.time + phase)*frequency;
float y;
x = x - Mathf.Floor(x); // normalized value (0..1)
if (waveFunction=="sin") {
y = Mathf.Sin(x*2*Mathf.PI);
}
else if (waveFunction=="tri") {
if (x < 0.5f)
y = 4.0f * x - 1.0f;
else
y = -4.0f * x + 3.0f;
}
else if (waveFunction=="sqr") {
if (x < 0.5f)
y = 1.0f;
else
y = -1.0f;
}
else if (waveFunction=="saw") {
y = x;
}
else if (waveFunction=="inv") {
y = 1.0f - x;
}
else if (waveFunction=="noise") {
y = 1 - (Random.value*2);
}
else {
y = 1.0f;
}
return (y*amplitude)+startValue;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: e700f8e20de2fdf4ab1bf79546b95202
timeCreated: 1509044237
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
namespace PolygonArsenal
{
public class PolygonRotation : MonoBehaviour
{
[Header("Rotate axises by degrees per second")]
public Vector3 rotateVector = Vector3.zero;
public enum spaceEnum { Local, World };
public spaceEnum rotateSpace;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (rotateSpace == spaceEnum.Local)
transform.Rotate(rotateVector * Time.deltaTime);
if (rotateSpace == spaceEnum.World)
transform.Rotate(rotateVector * Time.deltaTime, Space.World);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: bf86d4d543b2a3440b8b3ceb1db164c5
timeCreated: 1509044237
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace PolygonArsenal
{
public class PolygonSoundSpawn : MonoBehaviour
{
public GameObject prefabSound;
public bool destroyWhenDone = true;
public bool soundPrefabIsChild = false;
[Range(0.01f, 10f)]
public float pitchRandomMultiplier = 1f;
// Use this for initialization
void Start()
{
//Spawn the sound object
GameObject m_Sound = Instantiate(prefabSound, transform.position, Quaternion.identity);
AudioSource m_Source = m_Sound.GetComponent<AudioSource>();
//Attach object to parent if true
if (soundPrefabIsChild)
m_Sound.transform.SetParent(transform);
//Multiply pitch
if (pitchRandomMultiplier != 1)
{
if (Random.value < .5)
m_Source.pitch *= Random.Range(1 / pitchRandomMultiplier, 1);
else
m_Source.pitch *= Random.Range(1, pitchRandomMultiplier);
}
//Set lifespan if true
if (destroyWhenDone)
{
float life = m_Source.clip.length / m_Source.pitch;
Destroy(m_Sound, life);
}
}
}
}
fileFormatVersion: 2
guid: 5aa5c1e37409a9344a344c0468db383d
timeCreated: 1514648980
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9f9cc95afa300c449b95af94e1226da4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 13536afc703e2fc4296fcd9a29ffbd01
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: eb5f07f5f2d397f40b4b57caf42f4710
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 522167c7b8cbe114ea3dd84c7f1cfaf9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ff0559249fe2d7244ba268c28db2cf4a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 17c603196507b384f835c0aed85bea16
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 139b39134e1c7fa42891d09231737894
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment