Код: Выделить всё
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
public class Mototron : MonoBehaviour
{
public float speed = -21f;
private float targetAngle = 90f;
public float enemyK = 0f;
public bool isMoving = false;
public GameObject boxPrefab;
public GameObject deadCanvas;
public GameObject wonCanvas;
public bool box;
PhotonView view;
void Start()
{
view = GetComponent
();
}
public void Update ()
{
movement();
}
void movement ()
{
if(Input.GetKey(KeyCode.W) && view.IsMine)
{
transform.Translate(Vector3.forward * speed * Time.deltaTime);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/781 ... layer-game
Мобильная версия