Commit 2ba49325 authored by Ashley's avatar Ashley

added Torch and TorchPrefab

parent ce87482a
fileFormatVersion: 2
guid: d26b87629a33e7f4ea695aae8f4c5121
timeCreated: 1477614983
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6447dc2c5563810409fde3b2d66630cc
timeCreated: 1477613639
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 610ddd4392217474b923bb8ef67b3344
timeCreated: 1477613638
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8e3fef4918cc34643b1b36754416b44c
guid: 9f2b9f8232e8aef43b9a2de4500b7fff
folderAsset: yes
timeCreated: 1477029607
timeCreated: 1477613634
licenseType: Free
DefaultImporter:
userData:
......
fileFormatVersion: 2
guid: 9e2b88c6e90966c4893c40b3770da65a
guid: b81863a609d40aa4ca9995a23dc2e59d
folderAsset: yes
timeCreated: 1475761198
timeCreated: 1477613634
licenseType: Free
DefaultImporter:
userData:
......
fileFormatVersion: 2
guid: 026ac4c911a0e114891980ac911e46c6
guid: a7980e3cc7ad39d4aa968cb9fe241a0a
folderAsset: yes
timeCreated: 1475761198
timeCreated: 1477613634
licenseType: Free
DefaultImporter:
userData:
......
using UnityEngine;
using System.Collections;
[RequireComponent (typeof(Light))]
public class Torch : MonoBehaviour {
private Light myLight;
private SpriteRenderer currentSprite;
private Sprite unlitTorch = Resources.Load("Unlit torch side view", typeof(Sprite)) as Sprite;
private Sprite litTorch = Resources.Load("Lit torch side view", typeof(Sprite)) as Sprite;
// Use this for initialization
void Start () {
myLight = GetComponent<Light>();
currentSprite = this.GetComponent<SpriteRenderer>();
}
// Update is called once per frame
void Update () {
}
void activateTorch()
{
//activate the light component
if(!myLight.enabled)
{
myLight.enabled = true;
currentSprite.sprite = litTorch;
}
}
void deactivateTorch()
{
//deactivate the light component
if(myLight.enabled)
{
myLight.enabled = false;
currentSprite.sprite = unlitTorch;
}
}
}
fileFormatVersion: 2
guid: 32c585fb91f2b1b40bf71a0c915b3107
timeCreated: 1477009861
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 91273c6ae51601d4caf154810604da16
folderAsset: yes
timeCreated: 1477613634
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1da59afcee6825e45ba4c40317549cd6
timeCreated: 1477613638
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 42f44e0a69d63724f928d4e2bca07485
timeCreated: 1477613634
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a61f0453176bd344fb0f87de90ecd3dd
timeCreated: 1477613635
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1c1bfc2eec0e8304e85e36661980ee2f
timeCreated: 1477011008
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: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
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: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9b934d9462b5d1347bedf4b11823a78d
timeCreated: 1477011008
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: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
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: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
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