Browse Source

Merge branch 'develop' of https://git.joshuareason.com/Jam/GGJ_2021 into develop

develop
Jordan 3 years ago
parent
commit
cfc438190f
13 changed files with 230 additions and 36 deletions
  1. BIN
      Assets/Scenes/Base Layout.unity
  2. BIN
      Assets/Scenes/Testing Scenes/YeetScene.unity
  3. +0
    -9
      Assets/Scripts/Behaviours/IYeetable.cs
  4. +0
    -11
      Assets/Scripts/Behaviours/IYeetable.cs.meta
  5. +39
    -9
      Assets/Scripts/Behaviours/YeetController.cs
  6. +0
    -0
      Assets/Scripts/Behaviours/YeetHandle.cs
  7. +0
    -0
      Assets/Scripts/Behaviours/YeetHandle.cs.meta
  8. BIN
      Assets/World Assets/Audio/Music/1809121006_h'ns_pixiePolka_v1_JD.mp3
  9. +36
    -0
      Assets/World Assets/Audio/Music/1809121006_h'ns_pixiePolka_v1_JD.mp3.meta
  10. +1
    -1
      Assets/World Assets/Materials/Fence.mat
  11. BIN
      Assets/World Assets/Materials/Floor Texture.png
  12. BIN
      Assets/World Assets/Models/Wall Pictures/wallpicture.005.png
  13. +142
    -0
      Assets/World Assets/Models/Wall Pictures/wallpicture.005.png.meta

BIN
Assets/Scenes/Base Layout.unity (Stored with Git LFS) View File

size 648345

BIN
Assets/Scenes/Testing Scenes/YeetScene.unity (Stored with Git LFS) View File

size 18643

+ 0
- 9
Assets/Scripts/Behaviours/IYeetable.cs View File

@ -1,9 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public interface IYeetable
{
void Hold(GameObject child);
void Yeet();
}

+ 0
- 11
Assets/Scripts/Behaviours/IYeetable.cs.meta View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2bbcd198578c95d40a2dd8f089364686
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 39
- 9
Assets/Scripts/Behaviours/YeetController.cs View File

@ -6,18 +6,23 @@ public class YeetController : MonoBehaviour
{
public GameObject parent { get; set; }
public float yeetVelocity = 10f;
public float yeetVelocity = 5f;
public float yeetDuration = 2f;
public float windupSpeed = 0.01f;
public enum YeetState { Unheld, Held, Yeeting };
public YeetState yeetState { get; private set; } = YeetState.Unheld;
private GameObject _child;
private float _time;
private float m_time;
private GameObject m_child;
private GameObject m_body;
private float m_velocityWindup;
private LineRenderer m_lineRenderer;
private void Awake()
{
m_body = this.gameObject;
@ -28,39 +33,63 @@ public class YeetController : MonoBehaviour
_child = child;
_child.transform.parent = parent.transform;
yeetState = YeetState.Held;
m_lineRenderer = gameObject.AddComponent<LineRenderer>();
}
public void Yeet()
{
_child.transform.parent = null;
_child.transform.rotation = parent.transform.rotation;
_child.GetComponent<Rigidbody>().velocity = _child.transform.forward * yeetVelocity + _child.transform.up * yeetVelocity;
_child.GetComponent<Rigidbody>().velocity = _child.transform.forward * m_velocityWindup + _child.transform.up * m_velocityWindup;
yeetState = YeetState.Yeeting;
_time = yeetDuration;
m_time = yeetDuration;
m_velocityWindup = 0;
Destroy(m_lineRenderer);
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
switch(yeetState)
{
case YeetState.Yeeting:
//_child.transform.position += _child.transform.forward * yeetVelocity * Time.deltaTime;
_time -= Time.deltaTime;
m_time -= Time.deltaTime;
if(_time <= 0f)
if(m_time <= 0f)
{
Debug.Log("YeetController.Update: Yeet finished");
yeetState = YeetState.Unheld;
}
break;
case YeetState.Held:
// draw yeet lines
if(m_velocityWindup < yeetVelocity)
{
m_velocityWindup += windupSpeed;
}
Vector3 velocity = parent.transform.forward * m_velocityWindup + parent.transform.up * m_velocityWindup;
float t;
t = (-1f * velocity.y) / Physics.gravity.y;
t = 2f * t;
m_lineRenderer.positionCount = 10;
Vector3 trajectoryPoint;
for (int i = 0; i < m_lineRenderer.positionCount; i++)
{
float time = t * i / (float)(m_lineRenderer.positionCount);
trajectoryPoint = parent.transform.position + velocity * time + 0.5f * Physics.gravity * time * time;
m_lineRenderer.SetPosition(i, trajectoryPoint);
}
break;
case YeetState.Unheld:
_child = null;
@ -98,4 +127,5 @@ public class YeetController : MonoBehaviour
break;
}
}
}

Assets/YeetHandle.cs → Assets/Scripts/Behaviours/YeetHandle.cs View File


Assets/YeetHandle.cs.meta → Assets/Scripts/Behaviours/YeetHandle.cs.meta View File


BIN
Assets/World Assets/Audio/Music/1809121006_h'ns_pixiePolka_v1_JD.mp3 (Stored with Git LFS) View File

size 1772712

+ 36
- 0
Assets/World Assets/Audio/Music/1809121006_h'ns_pixiePolka_v1_JD.mp3.meta View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: d8a1b725779faea4ba344c4c0f22bf21
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

+ 1
- 1
Assets/World Assets/Materials/Fence.mat View File

@ -63,7 +63,7 @@ Material:
- _OcclusionStrength: 1
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

BIN
Assets/World Assets/Materials/Floor Texture.png (Stored with Git LFS) View File

size 4422138

BIN
Assets/World Assets/Models/Wall Pictures/wallpicture.005.png (Stored with Git LFS) View File

size 625530

+ 142
- 0
Assets/World Assets/Models/Wall Pictures/wallpicture.005.png.meta View File

@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: e1a6687a548757b488ff93a04e52faf0
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 2
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save