private void Awake() { isServer = GameObject.FindGameObjectWithTag("Network") .GetComponent <DarkRift.Server.Unity.XmlUnityServer>() != null; if (isServer) { lastSyncPostion = transform.localPosition; lastMoveVector = Vector3.zero; rb = GetComponent <Rigidbody>(); pVolume = GetComponentInChildren <PickupVolume>(); iVolume = GetComponentInChildren <InteractVolume>(); GetComponent <TTSID>().trackedDataSerialize += TrackedDataHandler; defaultColor = GetComponentInChildren <MeshRenderer>().material.color; } for (int i = 0; i < hatParent.transform.childCount; i++) { if (!hatParent.transform.GetChild(i).CompareTag("Hair")) { hats.Add(hatParent.transform.GetChild(i).gameObject); } } for (int i = 0; i < toolParent.transform.childCount; i++) { tools.Add(toolParent.transform.GetChild(i).gameObject); } }
public override void StartUse(Transform interactingTransform) { if (inUse) { Debug.LogError("Tried to use inUse object"); } else { interactingTransform.GetComponent <TTSPlayerAnimator>().SetBool(8, true); inUse = true; playerIV = interactingTransform.GetComponentInChildren <InteractVolume>(); StartCoroutine(useTimer()); } }