Skip to content

Commit c9ea944

Browse files
committed
Smoothly move a gameobject
1 parent 4e92323 commit c9ea944

File tree

69 files changed

+1010
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1010
-147
lines changed

Assets/Scenes/ui animation Sample Scene.unity.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/AssetBundles/AssetBundleLoader.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ IEnumerator DownloadAndCache(string bundleURL, string assetName = "")
8484
}
8585

8686
// now download the actual bundle, with hashString parameter it uses cached version if available
87-
www = UnityWebRequest.GetAssetBundle(bundleURL + "?r=" + (Random.value * 9999999), hashString, 0);
87+
www = UnityWebRequestAssetBundle.GetAssetBundle(bundleURL + "?r=" + (Random.value * 9999999), hashString, 0);
8888

8989
// wait for load to finish
90-
yield return www.Send();
90+
yield return www.SendWebRequest();
9191

9292
if (www.error != null)
9393
{

Assets/Scripts/Camera/MarrtsSmoothedMouseLook.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using UnityEngine;
2+
using System.Collections.Generic;
3+
using System.Collections;
4+
5+
//Script for moving a gameObject smoothly
6+
7+
namespace UnityLibary
8+
{
9+
public class PlayerMovement : MonoBehaviour
10+
{
11+
//attach the gameobject that you want to move
12+
public CharacterController controller;
13+
14+
public float speed = 5f;
15+
16+
void Update()
17+
{
18+
float x = Input.GetAxis("Horizontal");
19+
float z = Input.GetAxis("Vertical");
20+
21+
Vector3 move = transform.right * x + transform.forward * z;
22+
23+
controller.Move(move * speed * Time.deltaTime);
24+
25+
//Rotate clockwise
26+
if (Input.GetKey(KeyCode.E))
27+
{
28+
transform.RotateAround(transform.position, Vector3.up, 100 * Time.deltaTime);
29+
}
30+
31+
// Rotate anticlockwise
32+
if (Input.GetKey(KeyCode.Q))
33+
{
34+
transform.RotateAround(transform.position, -Vector3.up, 100 * Time.deltaTime);
35+
}
36+
37+
}
38+
39+
}
40+
}

Assets/Scripts/Camera/PlayerMovement.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor.meta renamed to Assets/Scripts/Docs/Mesh.meta

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Docs/Mesh/MeshExample.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Docs/UnityEngine/CullingGroupExample.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/ContextMenu.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/ContextMenu/BoxColliderFitChildren.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/ContextMenu/CreateOutlineForPanelEditor.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/ContextMenu/GetVideoAspectRatioEditor.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/ContextMenu/SetBoxColliderToUI.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/GameObject.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/GameObject/ResetTransform.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Gizmos/RendererBoundsGizmo.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Hierarchy.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Hierarchy/UnparentMe.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Mesh.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Mesh/CreatePlane.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Mesh/MeshCombineWizard.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Tools/ColorPickerWindow.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Tools/CompileTime.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Tools/ReferenceImageViewer.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Tools/SceneManagerWindow.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Editor/Tools/SceneSwitcherWindow.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Extensions/MonoBehaviourExtensions.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Extensions/MonoBehaviourExtensions/Example.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Extensions/MonoBehaviourExtensions/Example/MonoBehaviorExtensionsExample.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Extensions/MonoBehaviourExtensions/MonoBehaviourExtensions.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)