// Init rigidbody, center of mass, wheels and more void Awake() { player = ReInput.players.GetPlayer(playerId); stat = gameObject.GetComponent <StatusList>(); slot = gameObject.GetComponent <PowerUpSlot>(); slot.Initialize(1, this); isStarted = false; isEnded = false; }
// Start is called before the first frame update void Start() { stat = gameObject.GetComponent <StatusList>(); slot = gameObject.GetComponent <PowerUpSlot>(); slot.Initialize(1, this); beginned = false; ended = false; m_rigidbody = gameObject.GetComponent <Rigidbody>(); m_rigidbody.velocity = Vector3.zero; }
void OnTriggerEnter(Collider c) { WheelVehicle cart = c.gameObject.GetComponent <WheelVehicle>(); Debug.Log(c.gameObject); if (!cart) { return; } PowerUpSlot slot = cart.GetComponent <PowerUpSlot>(); if (slot.load(item)) { Destroy(gameObject); } }