protected virtual void Awake() { activePlayer = null; smoothYaw = new SmoothFloat(); smoothPitch = new SmoothFloat(); smoothTransform = gameObject.EnsureComponent <SmoothTransform>(); syncedObject = gameObject.EnsureComponent <SyncedObject>(); }
private void Process(ClientItemDropped msg) { var gameObject = ObjectSerializer.GetGameObject(msg.data); gameObject.transform.position = msg.position; GuidHelper.Set(gameObject, msg.itemGuid); var waterParkObject = GuidHelper.Find(msg.waterParkGuid); if (waterParkObject != null) { var waterPark = waterParkObject.GetComponent <WaterPark>(); if (waterPark != null) { var pickupable = gameObject.GetComponent <Pickupable>(); if (pickupable != null) { waterPark.AddItem(pickupable); } } } var rigidbody = gameObject.GetComponent <Rigidbody>(); if (rigidbody != null) { rigidbody.isKinematic = false; } SyncedObject.ApplyTo(gameObject); var constructor = gameObject.GetComponent <Constructor>(); if (constructor != null) { var method = typeof(Constructor).GetMethod("Deploy", BindingFlags.NonPublic | BindingFlags.Instance); method.Invoke(constructor, new object[] { true }); constructor.OnDeployAnimationStart(); LargeWorldEntity.Register(constructor.gameObject); Utils.PlayEnvSound(constructor.releaseSound, constructor.transform.position, 20f); } }