You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
951 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Networking.Client;
public class ConveyorBelt : MonoBehaviour
{
public ConnectedClients clientData;
bool characterOnBelt = false;
GameObject player;
string charname;
private List<string> Names;
private void Start()
{
for (int i = 0; i < clientData.AllClients.Count; i++)
{
Names.Add(clientData.AllClients[i].characterAnimal + "(Clone)");
}
}
void OnTriggerEnter(Collider other)
{
for (int i = 0; i < Names.Count; i++)
{
if (other.gameObject.name == Names[i])
{
characterOnBelt = true;
charname = other.gameObject.name;
}
}
}
public void Animate()
{
player = GameObject.Find(charname);
player.GetComponent<Character>().conveyorMove(Direction.Forward, 1.0f);
}
}