Compare commits
3 commits
c64c2f0dd1
...
46955bbec4
| Author | SHA1 | Date | |
|---|---|---|---|
| 46955bbec4 | |||
| 98f0b46b94 | |||
| 543f0e142e |
16 changed files with 1845 additions and 38 deletions
|
|
@ -11,6 +11,10 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
|||
|
||||
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 Step nextStep;
|
||||
|
|
@ -19,7 +23,7 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
|||
public readonly float time;
|
||||
public readonly Action action;
|
||||
|
||||
Task(float time, Action action) {
|
||||
public Task(float time, Action action) {
|
||||
this.time = time;
|
||||
this.action = action;
|
||||
}
|
||||
|
|
@ -27,12 +31,21 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
|||
|
||||
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
|
||||
void Start()
|
||||
{
|
||||
nextStep = Step.GROSSE_AUFREGUNG;
|
||||
taskList = new List<Task>();
|
||||
globalLight.GetComponent<Light2D>().intensity = 0;
|
||||
cameraComponent = GetComponent<Camera>();
|
||||
kleinerSternBewegung = kleinerStern.GetComponent<SternBewegung>();
|
||||
grosserSternBewegung = grosserStern.GetComponent<SternBewegung>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
|
@ -40,7 +53,7 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
|||
{
|
||||
List<Task> doneList = new List<Task>();
|
||||
foreach (Task t in taskList) {
|
||||
if (t.time >= Time.time) {
|
||||
if (Time.time >= t.time) {
|
||||
doneList.Add(t);
|
||||
t.action();
|
||||
}
|
||||
|
|
@ -75,14 +88,47 @@ public class AblaufKleinerStern1 : MonoBehaviour
|
|||
}
|
||||
|
||||
private void GrosseAufregung(){
|
||||
globalLight.GetComponent<Lichtsteuerung>().FadeToIntensity(1, 1);
|
||||
globalLight.GetComponent<Lichtsteuerung>().FadeToIntensity(1, 2);
|
||||
kleinerSternBewegung.GoToPosition(new Vector2(-12, -3.5f), 0f);
|
||||
grosserSternBewegung.GoToPosition(new Vector2(12, -3.5f), 0f);
|
||||
}
|
||||
|
||||
private void AuftrittKleinerStern(){}
|
||||
|
||||
private void AuftrittGrosserStern(){}
|
||||
|
||||
private void AbgangGrosserStern(){}
|
||||
|
||||
private void KleinerSternFaellt(){}
|
||||
private void AuftrittKleinerStern(){
|
||||
kleinerSternBewegung.GoToPosition(new Vector2(-3, -2f), 2f);
|
||||
}
|
||||
|
||||
private void AuftrittGrosserStern(){
|
||||
kleinerSternBewegung.randomnessIntensity = .01f;
|
||||
kleinerSternBewegung.wobblingAngle = 2f;
|
||||
kleinerSternBewegung.wobblingDuration = 1.5f;
|
||||
grosserSternBewegung.GoToPosition(new Vector2(3, -2f), 2.4f);
|
||||
}
|
||||
|
||||
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(){
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
111
Assets/HaseBewegung.cs
Normal file
111
Assets/HaseBewegung.cs
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
2
Assets/HaseBewegung.cs.meta
Normal file
2
Assets/HaseBewegung.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6f767d40a49ef8ae69c8d77658c9f238
|
||||
57
Assets/KontraktionBeiZusammenstoss.cs
Normal file
57
Assets/KontraktionBeiZusammenstoss.cs
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/KontraktionBeiZusammenstoss.cs.meta
Normal file
2
Assets/KontraktionBeiZusammenstoss.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4d5a8c1bee31534cd89760d59cc3aaf7
|
||||
|
|
@ -319,8 +319,9 @@ MonoBehaviour:
|
|||
randomnessIntensity: 0
|
||||
randomnessBaseAngle: 0
|
||||
randomMovementDuration: 100
|
||||
wobblingAngle: 8
|
||||
wobblingDuration: 2
|
||||
wobblingAngle: 5
|
||||
wobblingDuration: 3
|
||||
angularVelocity: 0
|
||||
--- !u!1 &1319994911
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -359,7 +360,7 @@ Camera:
|
|||
m_GameObject: {fileID: 1319994911}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
|
|
@ -475,6 +476,8 @@ MonoBehaviour:
|
|||
kleinerStern: {fileID: 1363739540}
|
||||
grosserStern: {fileID: 1314099120}
|
||||
globalLight: {fileID: 402771298}
|
||||
sternenhimmel: {fileID: 1741124233}
|
||||
hintergrund: {fileID: 2123825385}
|
||||
--- !u!114 &1319994917
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -482,7 +485,7 @@ MonoBehaviour:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1319994911}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9e8bac4050986ba529605346c1405c4d, type: 3}
|
||||
m_Name:
|
||||
|
|
@ -523,6 +526,7 @@ MonoBehaviour:
|
|||
randomMovementDuration: 0.2
|
||||
wobblingAngle: 10
|
||||
wobblingDuration: 0.6
|
||||
angularVelocity: 0
|
||||
--- !u!212 &1363739542
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -587,7 +591,7 @@ Transform:
|
|||
m_GameObject: {fileID: 1363739540}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -7.34, y: -2.76, z: 0}
|
||||
m_LocalPosition: {x: -5.82, y: -3.08, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
|
|
@ -680,6 +684,93 @@ Transform:
|
|||
m_Children: []
|
||||
m_Father: {fileID: 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
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -689,3 +780,4 @@ SceneRoots:
|
|||
- {fileID: 1363739543}
|
||||
- {fileID: 1314099122}
|
||||
- {fileID: 402771301}
|
||||
- {fileID: 2123825387}
|
||||
|
|
|
|||
1315
Assets/Scenes/kleiner_Stern_2.unity
Normal file
1315
Assets/Scenes/kleiner_Stern_2.unity
Normal file
File diff suppressed because it is too large
Load diff
7
Assets/Scenes/kleiner_Stern_2.unity.meta
Normal file
7
Assets/Scenes/kleiner_Stern_2.unity.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c2a4218f8d5b7a7e6b4254aee8acb1ae
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -13,6 +13,8 @@ public class SternBewegung : MonoBehaviour
|
|||
|
||||
public float wobblingDuration;
|
||||
|
||||
public float angularVelocity;
|
||||
|
||||
private Vector2 targetPosition;
|
||||
|
||||
private Vector2 startPosition;
|
||||
|
|
@ -27,16 +29,21 @@ public class SternBewegung : MonoBehaviour
|
|||
|
||||
private float endOfRandomMovement;
|
||||
|
||||
private float strictRotationAngle;
|
||||
|
||||
public void GoToPosition(Vector2 position, float duration){
|
||||
targetPosition = position;
|
||||
startPosition = transform.position;
|
||||
startPosition = (Vector2) transform.position - randomStrictDiff;
|
||||
timeOfArrival = Time.time + duration;
|
||||
timeOfDeparture = Time.time;
|
||||
}
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
public void GoToPositionWithVelocity(Vector2 position, float velocity){
|
||||
float dt = ((Vector2) transform.position - randomStrictDiff - position).magnitude / velocity;
|
||||
GoToPosition(position, dt);
|
||||
}
|
||||
|
||||
public void Initialize(){
|
||||
targetPosition = transform.position;
|
||||
startPosition = transform.position;
|
||||
timeOfArrival = 0f;
|
||||
|
|
@ -46,12 +53,18 @@ public class SternBewegung : MonoBehaviour
|
|||
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
|
||||
void Update()
|
||||
{
|
||||
Vector2 strictPos;
|
||||
if (Time.time >= timeOfDeparture && Time.time < timeOfArrival) {
|
||||
strictPos = Vector2.Lerp(startPosition, startPosition, (Time.time - timeOfDeparture)/(timeOfArrival - timeOfDeparture));
|
||||
strictPos = Vector2.Lerp(startPosition, targetPosition, (Time.time - timeOfDeparture)/(timeOfArrival - timeOfDeparture));
|
||||
} else {
|
||||
strictPos = targetPosition;
|
||||
}
|
||||
|
|
@ -72,12 +85,13 @@ public class SternBewegung : MonoBehaviour
|
|||
randomStrictDiff += randomMovement * Time.deltaTime;
|
||||
transform.position = strictPos + randomStrictDiff;
|
||||
|
||||
float rotationAngle;
|
||||
strictRotationAngle += angularVelocity * Time.deltaTime;
|
||||
float rotationAngle = strictRotationAngle;
|
||||
float normalizedTime = (Time.time % wobblingDuration) / wobblingDuration;
|
||||
if (normalizedTime < .5f){
|
||||
rotationAngle = - wobblingAngle + 4 * wobblingAngle * normalizedTime;
|
||||
rotationAngle += - wobblingAngle + 4 * wobblingAngle * normalizedTime;
|
||||
} else {
|
||||
rotationAngle = wobblingAngle - 4 * wobblingAngle * (normalizedTime - .5f);
|
||||
rotationAngle += wobblingAngle - 4 * wobblingAngle * (normalizedTime - .5f);
|
||||
}
|
||||
transform.rotation = Quaternion.AngleAxis(rotationAngle, Vector3.forward);
|
||||
}
|
||||
|
|
|
|||
BIN
Assets/ganze Figuren/kahler baum 4.gif
Normal file
BIN
Assets/ganze Figuren/kahler baum 4.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 148 KiB |
155
Assets/ganze Figuren/kahler baum 4.gif.meta
Normal file
155
Assets/ganze Figuren/kahler baum 4.gif.meta
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
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
|
||||
height: 169
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
|||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: ff302b9a91b8b97448ead14f87fbfdec
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
|||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
nameFileIdTable:
|
||||
kleiner Stern 1_0: 5761857568487738531
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ TextureImporter:
|
|||
y: 0
|
||||
width: 321
|
||||
height: 154
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
alignment: 9
|
||||
pivot: {x: 0.1634081, y: 0.7910883}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
|||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: d7b6061e5d3c8fbe1bad632a26aade62
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
|||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
nameFileIdTable:
|
||||
Hase - Hinterlauf_0: 2709113876856142783
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ TextureImporter:
|
|||
y: 302
|
||||
width: 284
|
||||
height: 221
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
alignment: 9
|
||||
pivot: {x: 0.14508723, y: 0.24813125}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
|||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: b8f477c259622ed74b27d69e25bde5a8
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
|||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
nameFileIdTable:
|
||||
Hase - Kopf_0: -593922422285043057
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ TextureImporter:
|
|||
y: 401
|
||||
width: 196
|
||||
height: 319
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
alignment: 9
|
||||
pivot: {x: 0.86098933, y: 0.07388813}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
|
|
@ -138,7 +138,7 @@ TextureImporter:
|
|||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: fab5fb4efe58b66b98bb459189641a00
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
|||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
nameFileIdTable:
|
||||
"Hase - L\xF6ffel_0": -7223738221184845235
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 2
|
||||
serializedVersion: 3
|
||||
tags: []
|
||||
layers:
|
||||
- Default
|
||||
|
|
@ -12,8 +12,8 @@ TagManager:
|
|||
- Water
|
||||
- UI
|
||||
-
|
||||
-
|
||||
-
|
||||
- Ground
|
||||
- Figure
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
@ -41,3 +41,5 @@ TagManager:
|
|||
- name: Default
|
||||
uniqueID: 0
|
||||
locked: 0
|
||||
m_RenderingLayers:
|
||||
- Default
|
||||
|
|
|
|||
Loading…
Reference in a new issue