Compare commits
No commits in common. "46955bbec41db282a25c8186f966dfab72123b6d" and "c64c2f0dd18a47f651d88a6dcb500e6a33e80deb" have entirely different histories.
46955bbec4
...
c64c2f0dd1
16 changed files with 38 additions and 1845 deletions
|
|
@ -11,10 +11,6 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
||||||
|
|
||||||
public GameObject globalLight;
|
public GameObject globalLight;
|
||||||
|
|
||||||
public GameObject sternenhimmel;
|
|
||||||
|
|
||||||
public GameObject hintergrund;
|
|
||||||
|
|
||||||
private enum Step {GROSSE_AUFREGUNG, AUFTRITT_KLEINER_STERN, AUFTRITT_GROSSER_STERN, ABGANG_GROSSER_STERN, KLEINER_STERN_FAELLT}
|
private enum Step {GROSSE_AUFREGUNG, AUFTRITT_KLEINER_STERN, AUFTRITT_GROSSER_STERN, ABGANG_GROSSER_STERN, KLEINER_STERN_FAELLT}
|
||||||
|
|
||||||
private Step nextStep;
|
private Step nextStep;
|
||||||
|
|
@ -23,7 +19,7 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
||||||
public readonly float time;
|
public readonly float time;
|
||||||
public readonly Action action;
|
public readonly Action action;
|
||||||
|
|
||||||
public Task(float time, Action action) {
|
Task(float time, Action action) {
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.action = action;
|
this.action = action;
|
||||||
}
|
}
|
||||||
|
|
@ -31,21 +27,12 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
||||||
|
|
||||||
private List<Task> taskList;
|
private List<Task> taskList;
|
||||||
|
|
||||||
private Camera cameraComponent;
|
|
||||||
|
|
||||||
private SternBewegung kleinerSternBewegung;
|
|
||||||
|
|
||||||
private SternBewegung grosserSternBewegung;
|
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
nextStep = Step.GROSSE_AUFREGUNG;
|
nextStep = Step.GROSSE_AUFREGUNG;
|
||||||
taskList = new List<Task>();
|
taskList = new List<Task>();
|
||||||
globalLight.GetComponent<Light2D>().intensity = 0;
|
globalLight.GetComponent<Light2D>().intensity = 0;
|
||||||
cameraComponent = GetComponent<Camera>();
|
|
||||||
kleinerSternBewegung = kleinerStern.GetComponent<SternBewegung>();
|
|
||||||
grosserSternBewegung = grosserStern.GetComponent<SternBewegung>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
|
@ -53,7 +40,7 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
||||||
{
|
{
|
||||||
List<Task> doneList = new List<Task>();
|
List<Task> doneList = new List<Task>();
|
||||||
foreach (Task t in taskList) {
|
foreach (Task t in taskList) {
|
||||||
if (Time.time >= t.time) {
|
if (t.time >= Time.time) {
|
||||||
doneList.Add(t);
|
doneList.Add(t);
|
||||||
t.action();
|
t.action();
|
||||||
}
|
}
|
||||||
|
|
@ -88,47 +75,14 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GrosseAufregung(){
|
private void GrosseAufregung(){
|
||||||
globalLight.GetComponent<Lichtsteuerung>().FadeToIntensity(1, 2);
|
globalLight.GetComponent<Lichtsteuerung>().FadeToIntensity(1, 1);
|
||||||
kleinerSternBewegung.GoToPosition(new Vector2(-12, -3.5f), 0f);
|
|
||||||
grosserSternBewegung.GoToPosition(new Vector2(12, -3.5f), 0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AuftrittKleinerStern(){
|
private void AuftrittKleinerStern(){}
|
||||||
kleinerSternBewegung.GoToPosition(new Vector2(-3, -2f), 2f);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AuftrittGrosserStern(){
|
private void AuftrittGrosserStern(){}
|
||||||
kleinerSternBewegung.randomnessIntensity = .01f;
|
|
||||||
kleinerSternBewegung.wobblingAngle = 2f;
|
|
||||||
kleinerSternBewegung.wobblingDuration = 1.5f;
|
|
||||||
grosserSternBewegung.GoToPosition(new Vector2(3, -2f), 2.4f);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AbgangGrosserStern(){
|
private void AbgangGrosserStern(){}
|
||||||
grosserStern.GetComponent<SpriteRenderer>().flipX = true;
|
|
||||||
grosserSternBewegung.GoToPosition(new Vector2(12, 0), 2);
|
|
||||||
kleinerSternBewegung.randomnessIntensity = 1;
|
|
||||||
kleinerSternBewegung.wobblingAngle = 10;
|
|
||||||
kleinerSternBewegung.wobblingDuration = .6f;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void KleinerSternFaellt(){
|
private void KleinerSternFaellt(){}
|
||||||
kleinerSternBewegung.angularVelocity = 300;
|
|
||||||
kleinerSternBewegung.GoToPosition(new Vector2(-4, -6), 1);
|
|
||||||
kleinerSternBewegung.randomnessIntensity = 0.01f;
|
|
||||||
doDelayed(1.0f, delegate(){
|
|
||||||
globalLight.GetComponent<Lichtsteuerung>().FadeToIntensity(0, .5f);
|
|
||||||
kleinerSternBewegung.GoToPosition(new Vector2(1, 6.5f), 0);
|
|
||||||
});
|
|
||||||
doDelayed(1.5f, delegate(){
|
|
||||||
hintergrund.GetComponent<SpriteRenderer>().color = Color.black;
|
|
||||||
sternenhimmel.SetActive(false);
|
|
||||||
globalLight.GetComponent<Lichtsteuerung>().FadeToIntensity(1, 0);
|
|
||||||
kleinerSternBewegung.GoToPosition(new Vector2(-1, -6.5f), 3);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doDelayed(float delay, Action task) {
|
|
||||||
taskList.Add(new Task(Time.time + delay, task));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,111 +0,0 @@
|
||||||
using Unity.Mathematics;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class HaseBewegung : MonoBehaviour
|
|
||||||
{
|
|
||||||
const float MAX_HINTERLAUF_ANGLE = 10;
|
|
||||||
const float HINTERLAUF_TIME = 1;
|
|
||||||
public float jumpVelocityX;
|
|
||||||
public float maxJumpVelocityY;
|
|
||||||
public float waitingTimeBetweenJumps;
|
|
||||||
public float earRigidity;
|
|
||||||
public GameObject hinterlauf;
|
|
||||||
public GameObject loeffel;
|
|
||||||
public GameObject kopf;
|
|
||||||
|
|
||||||
private float xTarget;
|
|
||||||
private uint collisions;
|
|
||||||
private float nextJumpTime;
|
|
||||||
private bool lookingRight;
|
|
||||||
private float jumpStartTime;
|
|
||||||
|
|
||||||
private Rigidbody2D rigidBody;
|
|
||||||
public void GoToXPosition(float x){
|
|
||||||
xTarget = x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Turn(){
|
|
||||||
GetComponent<SpriteRenderer>().flipX = lookingRight;
|
|
||||||
loeffel.GetComponent<SpriteRenderer>().flipX = lookingRight;
|
|
||||||
hinterlauf.GetComponent<SpriteRenderer>().flipX = lookingRight;
|
|
||||||
kopf.GetComponent<SpriteRenderer>().flipX = lookingRight;
|
|
||||||
lookingRight = !lookingRight;
|
|
||||||
Vector3 v = loeffel.transform.localPosition;
|
|
||||||
v.x = -v.x;
|
|
||||||
loeffel.transform.localPosition = v;
|
|
||||||
v = hinterlauf.transform.localPosition;
|
|
||||||
v.x = -v.x;
|
|
||||||
hinterlauf.transform.localPosition = v;
|
|
||||||
v = kopf.transform.localPosition;
|
|
||||||
v.x = -v.x;
|
|
||||||
kopf.transform.localPosition = v;
|
|
||||||
loeffel.transform.localRotation = Quaternion.Inverse(loeffel.transform.localRotation);
|
|
||||||
hinterlauf.transform.localRotation = Quaternion.Inverse(hinterlauf.transform.localRotation);
|
|
||||||
kopf.transform.localRotation = Quaternion.Inverse(kopf.transform.localRotation);
|
|
||||||
transform.rotation = Quaternion.Inverse(transform.rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
rigidBody = GetComponent<Rigidbody2D>();
|
|
||||||
collisions = 0;
|
|
||||||
lookingRight = true;
|
|
||||||
nextJumpTime = 0f;
|
|
||||||
jumpStartTime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
if (!targetReached()) {
|
|
||||||
if (collisions > 0){
|
|
||||||
if (Time.time > nextJumpTime){
|
|
||||||
StartJump();
|
|
||||||
nextJumpTime = 0;
|
|
||||||
} else if (nextJumpTime == 0){
|
|
||||||
nextJumpTime = Time.time + waitingTimeBetweenJumps;
|
|
||||||
rigidBody.linearVelocityX = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rigidBody.linearVelocityX = 0;
|
|
||||||
rigidBody.linearVelocityY = math.min(rigidBody.linearVelocityY, 0f);
|
|
||||||
}
|
|
||||||
float earAngle = math.acos(earRigidity / rigidBody.linearVelocityX) / math.PIHALF * 50;
|
|
||||||
loeffel.transform.localRotation = Quaternion.AngleAxis(earAngle, Vector3.forward);
|
|
||||||
float timeFactor = (Time.time - jumpStartTime) / HINTERLAUF_TIME;
|
|
||||||
if (timeFactor < .5f){
|
|
||||||
hinterlauf.transform.localRotation = Quaternion.AngleAxis(MAX_HINTERLAUF_ANGLE * timeFactor * 2, Vector3.forward);
|
|
||||||
} else if (timeFactor < 1.0f){
|
|
||||||
hinterlauf.transform.localRotation = Quaternion.AngleAxis(MAX_HINTERLAUF_ANGLE * (1 - timeFactor) * 2, Vector3.forward);
|
|
||||||
} else {
|
|
||||||
hinterlauf.transform.localRotation = Quaternion.identity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnCollisionEnter2D(Collision2D collision){
|
|
||||||
if (collision.gameObject.layer == 7){ //That layer is the ground.
|
|
||||||
if (collisions == 0){
|
|
||||||
rigidBody.linearVelocityX = 0;
|
|
||||||
}
|
|
||||||
collisions++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnCollisionExit2D(Collision2D collision){
|
|
||||||
if (collision.gameObject.layer == 7){ //That layer is the ground.
|
|
||||||
collisions--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartJump(){
|
|
||||||
rigidBody.linearVelocityX = jumpVelocityX;
|
|
||||||
rigidBody.linearVelocityY = maxJumpVelocityY;
|
|
||||||
jumpStartTime = Time.time;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool targetReached(){
|
|
||||||
return (lookingRight && transform.position.x >= xTarget) || (!lookingRight && transform.position.x <= xTarget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6f767d40a49ef8ae69c8d77658c9f238
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class KontraktionBeiZusammenstoss : MonoBehaviour
|
|
||||||
{
|
|
||||||
public float hardness;
|
|
||||||
private Vector2 originalScale;
|
|
||||||
private float originalArea;
|
|
||||||
private float originalSizeY;
|
|
||||||
private float velocity;
|
|
||||||
private bool ongoingAnimation;
|
|
||||||
private SpriteRenderer spriteRenderer;
|
|
||||||
private Rigidbody2D rigidBody;
|
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
ongoingAnimation = false;
|
|
||||||
velocity = 0;
|
|
||||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
|
||||||
rigidBody = GetComponent<Rigidbody2D>();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
if (ongoingAnimation){
|
|
||||||
float indent = (originalScale.y - transform.localScale.y) / originalScale.y * originalSizeY;
|
|
||||||
if (indent < 0) {
|
|
||||||
// one period completed, end animation
|
|
||||||
ongoingAnimation = false;
|
|
||||||
velocity = 0;
|
|
||||||
transform.localScale = originalScale;
|
|
||||||
} else {
|
|
||||||
float backwardsForce = indent * hardness;
|
|
||||||
velocity -= backwardsForce * Time.deltaTime;
|
|
||||||
float yScale = transform.localScale.y - velocity * Time.deltaTime / originalSizeY * originalScale.y;
|
|
||||||
float xScale = originalArea / yScale;
|
|
||||||
transform.localScale = new Vector3(xScale, yScale, transform.localScale.z);
|
|
||||||
transform.position += Vector3.down * velocity * Time.deltaTime;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
velocity = - rigidBody.linearVelocityY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnCollisionEnter2D(Collision2D collision) {
|
|
||||||
if (!ongoingAnimation){
|
|
||||||
ContactPoint2D[] contacts = new ContactPoint2D[collision.contactCount];
|
|
||||||
collision.GetContacts(contacts);
|
|
||||||
originalScale = transform.localScale;
|
|
||||||
originalArea = originalScale.x * originalScale.y;
|
|
||||||
originalSizeY = spriteRenderer.bounds.size.y;
|
|
||||||
ongoingAnimation = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 4d5a8c1bee31534cd89760d59cc3aaf7
|
|
||||||
|
|
@ -319,9 +319,8 @@ MonoBehaviour:
|
||||||
randomnessIntensity: 0
|
randomnessIntensity: 0
|
||||||
randomnessBaseAngle: 0
|
randomnessBaseAngle: 0
|
||||||
randomMovementDuration: 100
|
randomMovementDuration: 100
|
||||||
wobblingAngle: 5
|
wobblingAngle: 8
|
||||||
wobblingDuration: 3
|
wobblingDuration: 2
|
||||||
angularVelocity: 0
|
|
||||||
--- !u!1 &1319994911
|
--- !u!1 &1319994911
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -360,7 +359,7 @@ Camera:
|
||||||
m_GameObject: {fileID: 1319994911}
|
m_GameObject: {fileID: 1319994911}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_ClearFlags: 1
|
m_ClearFlags: 2
|
||||||
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0}
|
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0}
|
||||||
m_projectionMatrixMode: 1
|
m_projectionMatrixMode: 1
|
||||||
m_GateFitMode: 2
|
m_GateFitMode: 2
|
||||||
|
|
@ -476,8 +475,6 @@ MonoBehaviour:
|
||||||
kleinerStern: {fileID: 1363739540}
|
kleinerStern: {fileID: 1363739540}
|
||||||
grosserStern: {fileID: 1314099120}
|
grosserStern: {fileID: 1314099120}
|
||||||
globalLight: {fileID: 402771298}
|
globalLight: {fileID: 402771298}
|
||||||
sternenhimmel: {fileID: 1741124233}
|
|
||||||
hintergrund: {fileID: 2123825385}
|
|
||||||
--- !u!114 &1319994917
|
--- !u!114 &1319994917
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -485,7 +482,7 @@ MonoBehaviour:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1319994911}
|
m_GameObject: {fileID: 1319994911}
|
||||||
m_Enabled: 0
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 9e8bac4050986ba529605346c1405c4d, type: 3}
|
m_Script: {fileID: 11500000, guid: 9e8bac4050986ba529605346c1405c4d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
|
|
@ -526,7 +523,6 @@ MonoBehaviour:
|
||||||
randomMovementDuration: 0.2
|
randomMovementDuration: 0.2
|
||||||
wobblingAngle: 10
|
wobblingAngle: 10
|
||||||
wobblingDuration: 0.6
|
wobblingDuration: 0.6
|
||||||
angularVelocity: 0
|
|
||||||
--- !u!212 &1363739542
|
--- !u!212 &1363739542
|
||||||
SpriteRenderer:
|
SpriteRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -591,7 +587,7 @@ Transform:
|
||||||
m_GameObject: {fileID: 1363739540}
|
m_GameObject: {fileID: 1363739540}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -5.82, y: -3.08, z: 0}
|
m_LocalPosition: {x: -7.34, y: -2.76, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
|
@ -684,93 +680,6 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &2123825385
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 2123825387}
|
|
||||||
- component: {fileID: 2123825386}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Hintergrund
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!212 &2123825386
|
|
||||||
SpriteRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2123825385}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 0
|
|
||||||
m_ReceiveShadows: 0
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_StaticShadowCaster: 0
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 0
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
|
||||||
m_SmallMeshCulling: 1
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 0
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
m_FlipX: 0
|
|
||||||
m_FlipY: 0
|
|
||||||
m_DrawMode: 0
|
|
||||||
m_Size: {x: 1, y: 1}
|
|
||||||
m_AdaptiveModeThreshold: 0.5
|
|
||||||
m_SpriteTileMode: 0
|
|
||||||
m_WasSpriteAssigned: 1
|
|
||||||
m_MaskInteraction: 0
|
|
||||||
m_SpriteSortPoint: 0
|
|
||||||
--- !u!4 &2123825387
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2123825385}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -0.0144, y: 0.0577, z: 1}
|
|
||||||
m_LocalScale: {x: 18.51634, y: 10.667906, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1660057539 &9223372036854775807
|
--- !u!1660057539 &9223372036854775807
|
||||||
SceneRoots:
|
SceneRoots:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -780,4 +689,3 @@ SceneRoots:
|
||||||
- {fileID: 1363739543}
|
- {fileID: 1363739543}
|
||||||
- {fileID: 1314099122}
|
- {fileID: 1314099122}
|
||||||
- {fileID: 402771301}
|
- {fileID: 402771301}
|
||||||
- {fileID: 2123825387}
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: c2a4218f8d5b7a7e6b4254aee8acb1ae
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -13,8 +13,6 @@ public class SternBewegung : MonoBehaviour
|
||||||
|
|
||||||
public float wobblingDuration;
|
public float wobblingDuration;
|
||||||
|
|
||||||
public float angularVelocity;
|
|
||||||
|
|
||||||
private Vector2 targetPosition;
|
private Vector2 targetPosition;
|
||||||
|
|
||||||
private Vector2 startPosition;
|
private Vector2 startPosition;
|
||||||
|
|
@ -29,21 +27,16 @@ public class SternBewegung : MonoBehaviour
|
||||||
|
|
||||||
private float endOfRandomMovement;
|
private float endOfRandomMovement;
|
||||||
|
|
||||||
private float strictRotationAngle;
|
|
||||||
|
|
||||||
public void GoToPosition(Vector2 position, float duration){
|
public void GoToPosition(Vector2 position, float duration){
|
||||||
targetPosition = position;
|
targetPosition = position;
|
||||||
startPosition = (Vector2) transform.position - randomStrictDiff;
|
startPosition = transform.position;
|
||||||
timeOfArrival = Time.time + duration;
|
timeOfArrival = Time.time + duration;
|
||||||
timeOfDeparture = Time.time;
|
timeOfDeparture = Time.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GoToPositionWithVelocity(Vector2 position, float velocity){
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
float dt = ((Vector2) transform.position - randomStrictDiff - position).magnitude / velocity;
|
void Start()
|
||||||
GoToPosition(position, dt);
|
{
|
||||||
}
|
|
||||||
|
|
||||||
public void Initialize(){
|
|
||||||
targetPosition = transform.position;
|
targetPosition = transform.position;
|
||||||
startPosition = transform.position;
|
startPosition = transform.position;
|
||||||
timeOfArrival = 0f;
|
timeOfArrival = 0f;
|
||||||
|
|
@ -53,18 +46,12 @@ public class SternBewegung : MonoBehaviour
|
||||||
endOfRandomMovement = 0f;
|
endOfRandomMovement = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
Initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
Vector2 strictPos;
|
Vector2 strictPos;
|
||||||
if (Time.time >= timeOfDeparture && Time.time < timeOfArrival) {
|
if (Time.time >= timeOfDeparture && Time.time < timeOfArrival) {
|
||||||
strictPos = Vector2.Lerp(startPosition, targetPosition, (Time.time - timeOfDeparture)/(timeOfArrival - timeOfDeparture));
|
strictPos = Vector2.Lerp(startPosition, startPosition, (Time.time - timeOfDeparture)/(timeOfArrival - timeOfDeparture));
|
||||||
} else {
|
} else {
|
||||||
strictPos = targetPosition;
|
strictPos = targetPosition;
|
||||||
}
|
}
|
||||||
|
|
@ -85,13 +72,12 @@ public class SternBewegung : MonoBehaviour
|
||||||
randomStrictDiff += randomMovement * Time.deltaTime;
|
randomStrictDiff += randomMovement * Time.deltaTime;
|
||||||
transform.position = strictPos + randomStrictDiff;
|
transform.position = strictPos + randomStrictDiff;
|
||||||
|
|
||||||
strictRotationAngle += angularVelocity * Time.deltaTime;
|
float rotationAngle;
|
||||||
float rotationAngle = strictRotationAngle;
|
|
||||||
float normalizedTime = (Time.time % wobblingDuration) / wobblingDuration;
|
float normalizedTime = (Time.time % wobblingDuration) / wobblingDuration;
|
||||||
if (normalizedTime < .5f){
|
if (normalizedTime < .5f){
|
||||||
rotationAngle += - wobblingAngle + 4 * wobblingAngle * normalizedTime;
|
rotationAngle = - wobblingAngle + 4 * wobblingAngle * normalizedTime;
|
||||||
} else {
|
} else {
|
||||||
rotationAngle += wobblingAngle - 4 * wobblingAngle * (normalizedTime - .5f);
|
rotationAngle = wobblingAngle - 4 * wobblingAngle * (normalizedTime - .5f);
|
||||||
}
|
}
|
||||||
transform.rotation = Quaternion.AngleAxis(rotationAngle, Vector3.forward);
|
transform.rotation = Quaternion.AngleAxis(rotationAngle, Vector3.forward);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 148 KiB |
|
|
@ -1,155 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: de4068aaa994e379387d97db6a8fb9c9
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable:
|
|
||||||
- first:
|
|
||||||
213: -3129997030000298822
|
|
||||||
second: kahler baum 4_0
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 13
|
|
||||||
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
|
|
||||||
flipGreenChannel: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
vTOnly: 0
|
|
||||||
ignoreMipmapLimit: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: 1
|
|
||||||
aniso: 1
|
|
||||||
mipBias: 0
|
|
||||||
wrapU: 1
|
|
||||||
wrapV: 1
|
|
||||||
wrapW: 1
|
|
||||||
nPOTScale: 0
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 2
|
|
||||||
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
|
|
||||||
flipbookRows: 1
|
|
||||||
flipbookColumns: 1
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
ignorePngGamma: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
swizzle: 50462976
|
|
||||||
cookieLightType: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 4
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 4
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 4
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites:
|
|
||||||
- serializedVersion: 2
|
|
||||||
name: kahler baum 4_0
|
|
||||||
rect:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
width: 1083
|
|
||||||
height: 1345
|
|
||||||
alignment: 0
|
|
||||||
pivot: {x: 0, y: 0}
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
customData:
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
tessellationDetail: -1
|
|
||||||
bones: []
|
|
||||||
spriteID: ab4fdced8440094d0800000000000000
|
|
||||||
internalID: -3129997030000298822
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
outline: []
|
|
||||||
customData:
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID:
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
spriteCustomMetadata:
|
|
||||||
entries: []
|
|
||||||
nameFileIdTable: {}
|
|
||||||
mipmapLimitGroupName:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -121,7 +121,7 @@ TextureImporter:
|
||||||
width: 168
|
width: 168
|
||||||
height: 169
|
height: 169
|
||||||
alignment: 0
|
alignment: 0
|
||||||
pivot: {x: 0.5, y: 0.5}
|
pivot: {x: 0, y: 0}
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
customData:
|
customData:
|
||||||
outline: []
|
outline: []
|
||||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
||||||
customData:
|
customData:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID: ff302b9a91b8b97448ead14f87fbfdec
|
spriteID:
|
||||||
internalID: 0
|
internalID: 0
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
|
|
@ -147,8 +147,7 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable:
|
nameFileIdTable: {}
|
||||||
kleiner Stern 1_0: 5761857568487738531
|
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,8 @@ TextureImporter:
|
||||||
y: 0
|
y: 0
|
||||||
width: 321
|
width: 321
|
||||||
height: 154
|
height: 154
|
||||||
alignment: 9
|
alignment: 0
|
||||||
pivot: {x: 0.1634081, y: 0.7910883}
|
pivot: {x: 0, y: 0}
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
customData:
|
customData:
|
||||||
outline: []
|
outline: []
|
||||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
||||||
customData:
|
customData:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID: d7b6061e5d3c8fbe1bad632a26aade62
|
spriteID:
|
||||||
internalID: 0
|
internalID: 0
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
|
|
@ -147,8 +147,7 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable:
|
nameFileIdTable: {}
|
||||||
Hase - Hinterlauf_0: 2709113876856142783
|
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,8 @@ TextureImporter:
|
||||||
y: 302
|
y: 302
|
||||||
width: 284
|
width: 284
|
||||||
height: 221
|
height: 221
|
||||||
alignment: 9
|
alignment: 0
|
||||||
pivot: {x: 0.14508723, y: 0.24813125}
|
pivot: {x: 0, y: 0}
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
customData:
|
customData:
|
||||||
outline: []
|
outline: []
|
||||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
||||||
customData:
|
customData:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID: b8f477c259622ed74b27d69e25bde5a8
|
spriteID:
|
||||||
internalID: 0
|
internalID: 0
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
|
|
@ -147,8 +147,7 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable:
|
nameFileIdTable: {}
|
||||||
Hase - Kopf_0: -593922422285043057
|
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,8 @@ TextureImporter:
|
||||||
y: 401
|
y: 401
|
||||||
width: 196
|
width: 196
|
||||||
height: 319
|
height: 319
|
||||||
alignment: 9
|
alignment: 0
|
||||||
pivot: {x: 0.86098933, y: 0.07388813}
|
pivot: {x: 0, y: 0}
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
customData:
|
customData:
|
||||||
outline: []
|
outline: []
|
||||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
||||||
customData:
|
customData:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID: fab5fb4efe58b66b98bb459189641a00
|
spriteID:
|
||||||
internalID: 0
|
internalID: 0
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
|
|
@ -147,8 +147,7 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable:
|
nameFileIdTable: {}
|
||||||
"Hase - L\xF6ffel_0": -7223738221184845235
|
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!78 &1
|
--- !u!78 &1
|
||||||
TagManager:
|
TagManager:
|
||||||
serializedVersion: 3
|
serializedVersion: 2
|
||||||
tags: []
|
tags: []
|
||||||
layers:
|
layers:
|
||||||
- Default
|
- Default
|
||||||
|
|
@ -12,8 +12,8 @@ TagManager:
|
||||||
- Water
|
- Water
|
||||||
- UI
|
- UI
|
||||||
-
|
-
|
||||||
- Ground
|
-
|
||||||
- Figure
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
|
|
@ -41,5 +41,3 @@ TagManager:
|
||||||
- name: Default
|
- name: Default
|
||||||
uniqueID: 0
|
uniqueID: 0
|
||||||
locked: 0
|
locked: 0
|
||||||
m_RenderingLayers:
|
|
||||||
- Default
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue