Estava fazendo esse jogo quando apareceu este problema
Assets/SampleAssets/2D/Scripts/Platformer2DUserControl.cs(2,25): error CS0234: The type or namespace name
CrossPlatformInput' does not exist in the namespace
UnitySampleAssets'. Are you missing an assembly reference?
O meu código esta da seguinte maneira
using UnityEngine;
using UnitySampleAssets.CrossPlatformInput;
namespace UnitySampleAssets._2D
{
[RequireComponent(typeof (PlatformerCharacter2D))]
public class Platformer2DUserControl : MonoBehaviour
{
private PlatformerCharacter2D character;
private bool jump;
private void Awake()
{
character = GetComponent<PlatformerCharacter2D>();
}
private void Update()
{
if(!jump)
// Read the jump input in Update so button presses aren't missed.
jump = CrossPlatformInputManager.GetButtonDown("Jump");
}
private void FixedUpdate()
{
// Read the inputs.
bool crouch = Input.GetKey(KeyCode.LeftControl);
float h = CrossPlatformInputManager.GetAxis("Horizontal");
// Pass all parameters to the character control script.
character.Move(h, crouch, jump);
jump = false;
}
}
}
CrossPlatformInput
está presente?JavaScript
se o código éC#
?