UI
This commit is contained in:
26
09.09 Less_unity/Assets/Scripts/Jumping.cs
Normal file
26
09.09 Less_unity/Assets/Scripts/Jumping.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
//[RequireComponent(typeof(Rigidbody))] ;
|
||||
|
||||
public class Jumping : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float jumpForce;
|
||||
//Start is called before the first frame update
|
||||
private Rigidbody _rb;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_rb = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
//Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
_rb.AddForce(new Vector3(0, jumpForce, 0), ForceMode.Impulse);
|
||||
}
|
||||
}
|
||||
}
|
11
09.09 Less_unity/Assets/Scripts/Jumping.cs.meta
Normal file
11
09.09 Less_unity/Assets/Scripts/Jumping.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26110d49471e8874a9b6af0644b7a4f1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
24
09.09 Less_unity/Assets/Scripts/MessageDrawer.cs
Normal file
24
09.09 Less_unity/Assets/Scripts/MessageDrawer.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class Text : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] public string message;
|
||||
[SerializeField] private TextMeshProUGUI messagetext;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
messagetext.text = $"Message from inspector {message}" +
|
||||
$"\nnext line";
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
09.09 Less_unity/Assets/Scripts/MessageDrawer.cs.meta
Normal file
11
09.09 Less_unity/Assets/Scripts/MessageDrawer.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ec00d1e7f7a6234a97ec74385b59632
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user