blob: b713442b5205cf4a83e092d8dadf7e27bb6fd0bc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
using System;
using UnityEngine;
namespace Controllers.Player
{
[RequireComponent(typeof(Rigidbody2D))]
public class PlayerSegment : MonoBehaviour
{
[SerializeField] public Control left;
[SerializeField] public Control right;
[SerializeField] public Vector3 forceOrigin;
[SerializeField] public float height;
public Rigidbody2D Rigidbody => _rigidbody != null ? _rigidbody : _rigidbody = GetComponent<Rigidbody2D>();
private Rigidbody2D _rigidbody;
}
[Serializable]
public struct Control
{
public KeyCode keyCode;
public GameObject icon;
public GameObject leg;
public GameObject arm;
}
}
|