Ejemplo n.º 1
0
        private void Unwrench(HandApply interaction)
        {
            if (SpawnOnDeconstruct == null)
            {
                Logger.LogError($"{this} is missing reference to {nameof(SpawnOnDeconstruct)}!", Category.Interaction);
                return;
            }

            var spawn    = Spawn.ServerPrefab(SpawnOnDeconstruct, registerTile.WorldPositionServer, localRotation: directional.ByDegreesToQuaternion(directional.CurrentDirection));
            var PipeItem = spawn.GameObject.GetComponent <PipeItem>();

            PipeItem.rotatable.FaceDirection(directional.CurrentDirection);
            PipeItem.SetColour(Colour);

            OnDisassembly(interaction);
            pipeData.OnDisable();
            _ = Despawn.ServerSingle(gameObject);
        }