# Conflicts: # Assets/Scenes/SampleScene.unitymaster
@ -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); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 359f12e401afaba459299c65215a0995 | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@ -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"); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 0b578ca1f23b4664588275f98a3c3077 | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@ -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); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: fbe2851429fe8e8468394372c097ba45 | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@ -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} |
@ -0,0 +1,8 @@ | |||||
fileFormatVersion: 2 | |||||
guid: e2c9f2830f83b164cb943efc6bb88ba0 | |||||
NativeFormatImporter: | |||||
externalObjects: {} | |||||
mainObjectFileID: 0 | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |