Browse Source

Merge branch 'master' of https://bitbucket.org/JoshuaReason/ggj2020

# Conflicts:
#	Assets/Scenes/SampleScene.unity
master
NickFowler 4 years ago
parent
commit
4a6a2cee74
24 changed files with 1059 additions and 164 deletions
  1. +791
    -117
      Assets/Scenes/SampleScene.unity
  2. +21
    -0
      Assets/Scripts/BlackHole.cs
  3. +11
    -0
      Assets/Scripts/BlackHole.cs.meta
  4. +55
    -0
      Assets/Scripts/HammerController.cs
  5. +11
    -0
      Assets/Scripts/HammerController.cs.meta
  6. +37
    -0
      Assets/Scripts/Input/BallController.cs
  7. +11
    -0
      Assets/Scripts/Input/BallController.cs.meta
  8. +5
    -3
      Assets/Scripts/Input/HerdController.cs
  9. +1
    -13
      Assets/Scripts/Input/PlayerController.cs
  10. +8
    -9
      Assets/WorldAssets/Materials/Temp3.mat
  11. +78
    -0
      Assets/WorldAssets/Materials/Temp4.mat
  12. +8
    -0
      Assets/WorldAssets/Materials/Temp4.mat.meta
  13. +2
    -2
      Assets/WorldAssets/Models/BigBigSmallBushes.fbx.meta
  14. +1
    -1
      Assets/WorldAssets/Models/CrumblingWall.fbx.meta
  15. +1
    -1
      Assets/WorldAssets/Models/HorseModel.fbx.meta
  16. +2
    -2
      Assets/WorldAssets/Models/LongBushes.fbx.meta
  17. +2
    -2
      Assets/WorldAssets/Models/LongSledgeHammer.fbx.meta
  18. +2
    -2
      Assets/WorldAssets/Models/Rocks.fbx.meta
  19. +2
    -2
      Assets/WorldAssets/Models/ShortSledgeHammer.fbx.meta
  20. +2
    -2
      Assets/WorldAssets/Models/SmallBush.fbx.meta
  21. +2
    -2
      Assets/WorldAssets/Models/SmallBushes.fbx.meta
  22. +2
    -2
      Assets/WorldAssets/Models/SmallWideBushes.fbx.meta
  23. +2
    -2
      Assets/WorldAssets/Models/TallSmallBushes.fbx.meta
  24. +2
    -2
      Assets/WorldAssets/Models/TallWideBushes.fbx.meta

+ 791
- 117
Assets/Scenes/SampleScene.unity
File diff suppressed because it is too large
View File


+ 21
- 0
Assets/Scripts/BlackHole.cs View File

@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BlackHole : MonoBehaviour
{
[SerializeField]
private float Force = 5;
private void OnTriggerStay(Collider other)
{
var horse = other.GetComponent<PlayerController>();
if (horse != null)
{
Vector3 direction = horse.transform.position - transform.position;
horse.AddForce(direction.normalized * Force);
}
}
}

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

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

+ 55
- 0
Assets/Scripts/HammerController.cs View File

@ -0,0 +1,55 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HammerController : MonoBehaviour
{
[SerializeField]
private Vector2 AngleLimit;
[SerializeField]
private Vector3 RotationAxis;
[SerializeField]
private Vector3 HitDirection;
[SerializeField]
private float Force;
[SerializeField]
private float Speed;
private Vector3 startDir;
private void Start()
{
transform.forward = Vector3.up;
startDir = transform.forward;
}
// Update is called once per frame
void FixedUpdate()
{
float ratio = (Mathf.Sin(Time.time * Speed) + 1) / 2;
transform.forward = Quaternion.AngleAxis(Mathf.Lerp(AngleLimit.x, AngleLimit.y, ratio), transform.parent.InverseTransformDirection(RotationAxis)) * startDir;
Vector3 hitDirection = Quaternion.AngleAxis(Mathf.Lerp(AngleLimit.x, AngleLimit.y, ratio), transform.parent.InverseTransformDirection(RotationAxis)) * transform.parent.InverseTransformDirection(HitDirection) * -(Mathf.Cos(Time.time * Speed));
Debug.DrawRay(transform.position, hitDirection * Force, Color.green);
}
private void OnTriggerStay(Collider other)
{
var horse = other.GetComponent<PlayerController>();
if (horse != null)
{
float ratio = (Mathf.Sin(Time.time * Speed) + 1) / 2;
Vector3 hitDirection = Quaternion.AngleAxis(Mathf.Lerp(AngleLimit.x, AngleLimit.y, ratio), transform.parent.InverseTransformDirection(RotationAxis)) * transform.parent.InverseTransformDirection(HitDirection) * -(Mathf.Cos(Time.time * Speed));
horse.AddForce((hitDirection.normalized + Vector3.up) * Force);
Debug.Log("Hitting horse");
}
}
}

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

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

+ 37
- 0
Assets/Scripts/Input/BallController.cs View File

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BallController : MonoBehaviour
{
public int HorseCount;
public float size;
public GameObject horsePrefab;
// Start is called before the first frame update
void Start()
{
SpawnHorses();
}
// Update is called once per frame
void Update()
{
}
public void SpawnHorses()
{
for (int i = 0; i < HorseCount; i++)
{
Vector3 position = Random.onUnitSphere * size + transform.position;
Instantiate(horsePrefab, position,Random.rotation , transform);
}
}
}

+ 11
- 0
Assets/Scripts/Input/BallController.cs.meta View File

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

+ 5
- 3
Assets/Scripts/Input/HerdController.cs View File

@ -129,9 +129,11 @@ public class HerdController : MonoBehaviour
}
}
Centre.position = centreofMass/CountedHorses;
Centre.localScale = bound.size * 0.9f;
if (CountedHorses != 0)
{
Centre.position = centreofMass / CountedHorses;
Centre.localScale = bound.size * 0.75f;
}
}
else
{

+ 1
- 13
Assets/Scripts/Input/PlayerController.cs View File

@ -78,18 +78,6 @@ public class PlayerController : MonoBehaviour
isRagdoll = false;
//float rotateTo = RotateObject(HorseX, HorseZ);
//HorseZ *= Time.deltaTime * walkSpeed * speedMulitplier;
//HorseX *= Time.deltaTime * walkSpeed * speedMulitplier;
//
//
//transform.Translate(HorseX, 0, HorseZ);
//Vector3 dir = Quaternion.Euler(-90, rotateTo, 0) * Vector3.forward;
//model.transform.forward = dir;
//LeanTween.rotateY(model, rotateTo, 0.1f);
}
public float RotateObject(float xInput, float zInput)
@ -129,7 +117,7 @@ public class PlayerController : MonoBehaviour
Vector3 input = receivedInput;
yield return new WaitForSeconds(UnityEngine.Random.Range(0, wait / 2));
if (/*cController.isGrounded*/ true)
if (cController.isGrounded)
{
Vector3 rotateDir = new Vector3(90 * Math.Sign(input.y), 0, -90 * Math.Sign(input.x));
model.transform.Rotate(rotateDir, Space.World);

+ 8
- 9
Assets/WorldAssets/Materials/Temp3.mat View File

@ -8,14 +8,13 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Temp3
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
@ -60,19 +59,19 @@ Material:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 3
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0.15686275}
- _Color: {r: 0.16981131, g: 0.16981131, b: 0.16981131, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

+ 78
- 0
Assets/WorldAssets/Materials/Temp4.mat View File

@ -0,0 +1,78 @@
%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: Temp4
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
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: 0}
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0.15686275}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

+ 8
- 0
Assets/WorldAssets/Materials/Temp4.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e2c9f2830f83b164cb943efc6bb88ba0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

+ 2
- 2
Assets/WorldAssets/Models/BigBigSmallBushes.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 1
- 1
Assets/WorldAssets/Models/CrumblingWall.fbx.meta View File

@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 35
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 1
- 1
Assets/WorldAssets/Models/HorseModel.fbx.meta View File

@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 35
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/LongBushes.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/LongSledgeHammer.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 20
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.19999999
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/Rocks.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/ShortSledgeHammer.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/SmallBush.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/SmallBushes.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/SmallWideBushes.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/TallSmallBushes.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

+ 2
- 2
Assets/WorldAssets/Models/TallWideBushes.fbx.meta View File

@ -39,7 +39,7 @@ ModelImporter:
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
globalScale: 35
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
@ -85,7 +85,7 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
globalScale: 0.35
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0

Loading…
Cancel
Save