Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
671 changes: 671 additions & 0 deletions Assets/Scenes/LinearInterpolation.unity

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Assets/Scenes/LinearInterpolation.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 140 additions & 0 deletions Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,149 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1109283125
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1109283129}
- component: {fileID: 1109283128}
- component: {fileID: 1109283127}
- component: {fileID: 1109283126}
- component: {fileID: 1109283130}
- component: {fileID: 1109283131}
m_Layer: 0
m_Name: Square
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1109283126
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109283125}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c17b52fda48ed814fa009c05c903c020, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1109283127
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109283125}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c17b52fda48ed814fa009c05c903c020, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!212 &1109283128
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109283125}
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: 0.745283, g: 0.745283, b: 0.745283, 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 &1109283129
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109283125}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.9565892, y: 0.08325899, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1109283130
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109283125}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c17b52fda48ed814fa009c05c903c020, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1109283131
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109283125}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c17b52fda48ed814fa009c05c903c020, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 519420032}
- {fileID: 619394802}
- {fileID: 1109283129}
8 changes: 8 additions & 0 deletions Assets/script.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Assets/script/FirstScript1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using UnityEngine;

public class FirstScript1 : MonoBehaviour
{
float speed = 0.05f;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{

}

// Update is called once per frame
void Update()
{
Vector2 newPosition = transform.position;
newPosition.x += speed;
transform.position = newPosition;


Vector2 screenPos = Camera.main.WorldToScreenPoint(transform.position);

if (screenPos.x > Screen.width - 5 || screenPos.x < 0 + 5)
{
speed = speed * -1;
}

}
}
2 changes: 2 additions & 0 deletions Assets/script/FirstScript1.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Assets/script/FollowMe.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Rendering;

public class FollowMe : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{

}

// Update is called once per frame
void Update()
{

Vector3 mousePos = Camera.main.ScreenToWorldPoint(Mouse.current.position.ReadValue()); ;
mousePos.z = 0;
transform.position = mousePos;


}
}
2 changes: 2 additions & 0 deletions Assets/script/FollowMe.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions Assets/script/LinearInterpolation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using UnityEngine;
using UnityEngine.InputSystem;

public class LinearInterpolation : MonoBehaviour
{
public Transform start;
public Transform end;
public float t;
public AnimationCurve curve;
public Vector2 speed = new Vector2(0.1f,0.1f);


// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}

// Update is called once per frame
void Update()
{
Vector2 newPos = Camera.main.WorldToScreenPoint(transform.position);
if (t > 1f || t < 0f || newPos.x > Screen.width || newPos.x < 0 || newPos.y > Screen.height || newPos.y < 0)
{
speed *= -1;

}

t += speed.x * Time.deltaTime;
t += speed.y * Time.deltaTime;

float y = curve.Evaluate(t);
transform.position = Vector2.Lerp(start.position, end.position, y);



//Vector3 newSize = Vector3.one * y;
// transform.localScale = Vector3.one * curve.Evaluate(t);
// newSize = transform.localScale;
}
}
2 changes: 2 additions & 0 deletions Assets/script/LinearInterpolation.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Assets/script/Pulse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Unity.VisualScripting;
using UnityEngine;

public class Pulse : MonoBehaviour
{
public AnimationCurve curve;
public float t;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{

}

// Update is called once per frame
void Update()
{
t += Time.deltaTime;
if (t > 1f)
{
t = 0f;
}

float y = curve.Evaluate(t);
Vector3 newSize = Vector3.one * y;
transform.localScale = Vector3.one * curve.Evaluate(t);
newSize = transform.localScale;
}
}
2 changes: 2 additions & 0 deletions Assets/script/Pulse.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions Assets/script/Timer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using UnityEditor.Tilemaps;
using UnityEngine;

public class Timer : MonoBehaviour
{
public Vector2 NewPosition;
public float coldDown = 3;
public float time;

// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{

transform.position = new Vector2(Random.Range(-5,5),Random.Range(-5,5));

}

// Update is called once per frame
void Update()
{
time += Time.deltaTime;
if (time > coldDown)
{
transform.position = new Vector2(Random.Range(-5,5),Random.Range(-5,5));
time = 0;
}

}
}
2 changes: 2 additions & 0 deletions Assets/script/Timer.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading