-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96e965c
commit 7df7fd0
Showing
5 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.InputSystem; | ||
|
||
public class ChangeLight : MonoBehaviour | ||
{ | ||
public InputActionReference changeLight; | ||
Light chnglight; | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
changeLight.action.Enable(); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
chnglight = GetComponent<Light>(); | ||
|
||
if (chnglight.color == Color.white){ | ||
changeLight.action.performed += (ctx) => | ||
{ | ||
chnglight.color = Color.blue; | ||
}; | ||
} | ||
if (chnglight.color == Color.blue){ | ||
changeLight.action.performed += (ctx) => | ||
{ | ||
chnglight.color = Color.white; | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class MoonRotation : MonoBehaviour | ||
{ | ||
public float degreesPerSecond = 10.0f; | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
transform.Rotate(0, 0, degreesPerSecond * Time.deltaTime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.InputSystem; | ||
|
||
|
||
public class PlayerTransform : MonoBehaviour | ||
{ | ||
public InputActionReference tf; | ||
private Vector3 InitialPosition = new Vector3(0.0f, 4.0f, -6.5f); | ||
private Vector3 TransformPosition = new Vector3(-23.5f, 17.5f, -10f); | ||
|
||
// tf = GetComponent<transform>(); | ||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
tf.action.Enable(); | ||
if (transform.position == InitialPosition){ | ||
tf.action.performed += (ctx) => | ||
{ | ||
transform.position = TransformPosition; | ||
}; | ||
} | ||
if (transform.position == TransformPosition){ | ||
tf.action.performed += (ctx) => | ||
{ | ||
transform.position = InitialPosition; | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.InputSystem; | ||
|
||
public class Quit : MonoBehaviour | ||
{ | ||
public InputActionReference action; | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
|
||
} | ||
|
||
void Update() | ||
{ | ||
action.action.Enable(); | ||
action.action.performed += (ctx) => | ||
{ | ||
#if UNITY_EDITOR | ||
UnityEditor.EditorApplication.isPlaying = false; | ||
#else | ||
Application.Quit(); | ||
#endif | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class RotateSphere : MonoBehaviour | ||
{ | ||
public float degreesPerSecond = 10.0f; | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
transform.Rotate(0, degreesPerSecond * Time.deltaTime, 0); | ||
} | ||
} |