private void GroundCheker()
{
Vector3 chechSpherePos = new Vector3(transform.position.x, transform.position.y + _sphereOffSet, transform.position.z);
_isGround = Physics.CheckSphere(chechSpherePos, _sphereCheckRad, _groundMask);
}
//private void OnDrawGizmos() //visDebug
//{
// Gizmos.color = Color.red;
// Gizmos.DrawSphere(transform.position + Vector3.up * _sphereOffSet, _sphereCheckRad);
//}
using Unity.Netcode;
using UnityEngine;
public class Owner : NetworkBehaviour
{
[SerializeField]MeshRenderer _mR;
private void Start()
{
if (IsOwner) HideModel();
}
void HideModel()
{
_mR = GetComponent<MeshRenderer>();
_mR.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
}
}
thisv3 = Normalize(thisv3);
Vector3 Normalize(Vector3 v3)
{
return v3.normalized;
}
[SerializeField]Vector3 _normalized;
[SerializeField]Vector3 _normal;
[SerializeField]Vector3 _newVector1;
[SerializeField] Vector3 _newVector2;
private void Update()
{
_normalized.Set(Input.GetAxis("Vertical"), 0, Input.GetAxis("Horizontal"));
_normal.Set(Input.GetAxis("Vertical"), 0, Input.GetAxis("Horizontal"));
_newVector1 = _normalized.normalized;
_normal.Normalize();
_newVector2 = _normal;
}
using UnityEngine;
using UnityEngine.UI;
public class UI : MonoBehaviour
{
[SerializeField] Button _Button;
private void Awake()
{
_Button.onClick.AddListener(() =>
{
//что то делает
}
);
}
}
public IEnumerator Enumsdsdsdsd()
{
yield return new WaitForSeconds(0); // если будет тут то все запустится с первым апдейтом
for (int i = 0; i < playedXTimes; i++)
{
audioSource.clip = music; // это скорее всего не надо
audioSource.PlayOneShot(music);
}
yield return new WaitForSeconds(0); //если тут то все запустится при старте
}
Transform.LocalRotation = Quaternion.Euler(xRotation, 0f, 0f);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
SpriteRenderer rend;
rend.sortingOrder = (int)(transform.position.y*-10f);