mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-25 09:30:58 +00:00
Merge branch 'master' of https://github.com/ConjureETS/PillowFight
This commit is contained in:
commit
9ce93ceca6
@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 35d7b15c1b28c814794cc806cb06a6e9
|
guid: 20a38383cf02483478e2ec6290ca826a
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1440209531
|
timeCreated: 1440210034
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
9
Assets/Art/Sprites.meta
Normal file
9
Assets/Art/Sprites.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ff238c13ee4455348a494b7f8e84b44b
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1440262328
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
9
Assets/Art/Sprites/Materials.meta
Normal file
9
Assets/Art/Sprites/Materials.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9264b7464f0b2a04d951cf9fbfef3019
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1440262930
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Art/Sprites/Materials/Megamom.mat
Normal file
BIN
Assets/Art/Sprites/Materials/Megamom.mat
Normal file
Binary file not shown.
8
Assets/Art/Sprites/Materials/Megamom.mat.meta
Normal file
8
Assets/Art/Sprites/Materials/Megamom.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a982ca76f16291a469a3532007a4cb13
|
||||||
|
timeCreated: 1440262931
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Art/Sprites/Materials/Megamom2.mat
Normal file
BIN
Assets/Art/Sprites/Materials/Megamom2.mat
Normal file
Binary file not shown.
8
Assets/Art/Sprites/Materials/Megamom2.mat.meta
Normal file
8
Assets/Art/Sprites/Materials/Megamom2.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11cc80c6443f5ea4190c0041d3858a7e
|
||||||
|
timeCreated: 1440263521
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Art/Sprites/MegamomNormal.png
Normal file
BIN
Assets/Art/Sprites/MegamomNormal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
55
Assets/Art/Sprites/MegamomNormal.png.meta
Normal file
55
Assets/Art/Sprites/MegamomNormal.png.meta
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d8eead0b348e6814d877c5d98b8fb4fa
|
||||||
|
timeCreated: 1440264201
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 1
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 1
|
||||||
|
externalNormalMap: 1
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 8
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: 2
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: 1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Art/Sprites/MegamomTex.png
Normal file
BIN
Assets/Art/Sprites/MegamomTex.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
55
Assets/Art/Sprites/MegamomTex.png.meta
Normal file
55
Assets/Art/Sprites/MegamomTex.png.meta
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a2bec7dd3416205468bb86b85886ed6c
|
||||||
|
timeCreated: 1440264178
|
||||||
|
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: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 1
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 8
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: 2
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: 0
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 53bff6c471c632c4e94ded502d898a72
|
guid: a1b68b3746563664e96594bbf34c2243
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1440209485
|
timeCreated: 1440210034
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
Binary file not shown.
BIN
Assets/Materials/SpriteMom.mat
Normal file
BIN
Assets/Materials/SpriteMom.mat
Normal file
Binary file not shown.
8
Assets/Materials/SpriteMom.mat.meta
Normal file
8
Assets/Materials/SpriteMom.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 875ccc0b27596c84b9faab65d1b2272b
|
||||||
|
timeCreated: 1440263709
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 70345ee2f2d9f624e99bd686617b43c5
|
guid: 4173f5218215fc34bb9ee433a1db403f
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1440209479
|
timeCreated: 1440210034
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 61927a802a14ae2428ecc6b11539bfb0
|
guid: 47853bf99a9cfe34190154b10c14bd41
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1440209472
|
timeCreated: 1440210034
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
BIN
Assets/Scenes/MomLightSimon.unity
Normal file
BIN
Assets/Scenes/MomLightSimon.unity
Normal file
Binary file not shown.
8
Assets/Scenes/MomLightSimon.unity.meta
Normal file
8
Assets/Scenes/MomLightSimon.unity.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: df0b0e44ea338844b83cceb8f298758e
|
||||||
|
timeCreated: 1440254655
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6bbe73bf6fc643b4884dba45b721bbcf
|
guid: 2653fcd9ac4f2664ab959d3420967ff3
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1440209547
|
timeCreated: 1440210034
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -25,22 +25,28 @@ public class AutoTarget : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Transform GetTarget(Vector3 lookingAngle) {
|
public Transform GetTarget(Vector3 lookingAngle) {
|
||||||
|
|
||||||
Transform closest = null;
|
Transform closest = null;
|
||||||
float minAngle = minAngleRange;
|
float minAngle = minAngleRange;
|
||||||
|
|
||||||
|
Debug.Log("looking direction:" + lookingAngle);
|
||||||
|
|
||||||
|
|
||||||
foreach (Transform t in targets) {
|
foreach (Transform t in targets) {
|
||||||
Vector3 targetDirection = t.transform.position - transform.position;
|
Vector3 targetDirection = t.transform.position - transform.position;
|
||||||
|
|
||||||
|
float realAngle = Mathf.Atan2(targetDirection.z, targetDirection.x) * Mathf.Rad2Deg;
|
||||||
|
Debug.Log("real angle:" + realAngle);
|
||||||
|
|
||||||
|
float lookAngle = Mathf.Atan2(lookingAngle.z, lookingAngle.x) * Mathf.Rad2Deg;
|
||||||
|
Debug.Log("look angle:" + lookAngle);
|
||||||
|
|
||||||
float dot = Vector3.Dot(targetDirection, lookingAngle);
|
|
||||||
float angle = Mathf.Acos(dot) * Mathf.Rad2Deg;
|
|
||||||
|
|
||||||
if (angle < minAngle) {
|
if (Mathf.Abs(lookAngle - realAngle) < minAngle) {
|
||||||
minAngle = angle;
|
minAngle = lookAngle;
|
||||||
closest = t;
|
closest = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return closest;
|
return closest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -75,9 +75,19 @@ public class ChildController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (xLookingValue != 0 || zLookingValue != 0) {
|
if (xLookingValue != 0 || zLookingValue != 0) {
|
||||||
//transform.rotation = new Quaternion(0, 1, 0, Mathf.Atan2(zLookingValue, xLookingValue));
|
Transform target = _autoTarget.GetTarget(new Vector3(xLookingValue, 0, zLookingValue));
|
||||||
transform.eulerAngles = new Vector3(transform.eulerAngles.x, Mathf.Atan2(xLookingValue, zLookingValue) * Mathf.Rad2Deg, transform.eulerAngles.z);
|
|
||||||
_child.target = _autoTarget.GetTarget(new Vector3(xLookingValue, 0, zLookingValue));
|
_child.target = target;
|
||||||
|
if (_child.target != null) {
|
||||||
|
transform.LookAt(_child.target);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
transform.eulerAngles = new Vector3(
|
||||||
|
transform.eulerAngles.x,
|
||||||
|
Mathf.Atan2(xLookingValue, zLookingValue) * Mathf.Rad2Deg,
|
||||||
|
transform.eulerAngles.z);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
public class Pillow : MonoBehaviour {
|
public class Pillow : MonoBehaviour {
|
||||||
|
|
||||||
|
public bool IsThrown = false;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
@ -10,7 +12,20 @@ public class Pillow : MonoBehaviour {
|
|||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
void Update () {
|
||||||
|
if (transform.position.y < -10) {
|
||||||
|
Destroy(this.gameObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnTriggerEnter(Collider other) {
|
||||||
|
if (IsThrown && other.tag == "Player") {
|
||||||
|
|
||||||
|
Debug.Log("A child got hit by a pillow!");
|
||||||
|
|
||||||
|
//other.GetComponent<Child>().takeHit();
|
||||||
|
|
||||||
|
Destroy(this.gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
9
Assets/Test.meta
Normal file
9
Assets/Test.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 03870f11c780e164d82b313bbf402922
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1440264961
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
41
Assets/Test/Door.cs
Normal file
41
Assets/Test/Door.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class Door : MonoBehaviour {
|
||||||
|
|
||||||
|
private float state = 0f; //From 0 to 1 (closed to open)
|
||||||
|
private float goal = -1f; //-1 or 1
|
||||||
|
public float angles;
|
||||||
|
public float openingSpeed;
|
||||||
|
public AnimationCurve curvature;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
if (Input.GetKeyDown(KeyCode.A))
|
||||||
|
{
|
||||||
|
goal *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
state = Mathf.Clamp(state + goal * openingSpeed * Time.deltaTime, 0f, 1f);
|
||||||
|
|
||||||
|
//transform.rotation = Quaternion.identity;
|
||||||
|
//transform.Rotate(Vector3.up * state * angles);
|
||||||
|
transform.rotation = Quaternion.Euler(Vector3.up * curvature.Evaluate(state) * -angles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Open()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Test/Door.cs.meta
Normal file
12
Assets/Test/Door.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c921a0b390e23b64a94eb3e55d68e369
|
||||||
|
timeCreated: 1440269019
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
19
Assets/Test/LightOnOff.cs
Normal file
19
Assets/Test/LightOnOff.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
[RequireComponent(typeof(Light))]
|
||||||
|
public class LightOnOff : MonoBehaviour {
|
||||||
|
|
||||||
|
private Light light;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
light = GetComponent<Light>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
if(Input.GetKeyDown(KeyCode.Space))
|
||||||
|
light.enabled = !light.enabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Test/LightOnOff.cs.meta
Normal file
12
Assets/Test/LightOnOff.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11e1c2efd004a114cb9e2b988d81ac69
|
||||||
|
timeCreated: 1440264969
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 5.1.2f1
|
m_EditorVersion: 5.0.2f1
|
||||||
m_StandardAssetsVersion: 0
|
m_StandardAssetsVersion: 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user