private void InteractWithStaticObject(int actionId, NetworkPlayer myPlayer, int objInstance, int objId, float objDist, Vector3 objPos) { myPlayer.MoveToAndInteractWith(ObjectInteraction.Create(myPlayer, new StaticObject { ObjectData = objectManager.GetObjectData(objId), ObjectId = objId, Instance = objInstance, Distance = objDist, Position = objPos, }, actionId), CheckIfRunning()); }
private void HandleLeftClick(NetworkPlayer me, MouseClickEventArgs e) { uiManager.ContextMenu.Hide(); // ignore other players for now since we don't have // a left button action on players yet. Going to be for selecting/targeting players. var player = e.GetNetworkPlayer(); if (player) { UnityEngine.Debug.Log("We left clicked on a player."); return; } var npc = e.GetNetworkNpc(); if (npc) { me.MoveToAndInteractWith(NpcInteraction.Create(me, npc, -1), CheckIfRunning()); return; } var worldObject = e.GetNetworkObject(); //var worldObject = e.Object.transform.GetComponentInParent<NetworkObject>(); if (worldObject) { me.MoveToAndInteractWith(ObjectInteraction.Create(me, worldObject), CheckIfRunning()); return; } if (moveSound) { moveSound.Play(); } var terrainHit = e.GetTerrain(); //var terrain = e.Object.transform.GetComponent<Terrain>(); if (terrainHit.Terrain) { HandleTerrainInteraction(e, terrainHit.Terrain, terrainHit.Point); return; } WalkTo(me, terrainHit.Point); }
private static RoomObjectBlueprint ControlRoomMicrophoneBlueprint() { RoomObjectBlueprint blueprint = new RoomObjectBlueprint(RoomObjectName.ControlRoomMicrophone) .WithName("Microphone") .WithMenuDescription("Test one, two") .WithObjectInteractions(new ObjectInteraction[] { ObjectInteraction.Create(ObjectInteractionType.Perform, "Speak", ObjectInteractionCharacterRole.CharacterAtRoomObject) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("Everyone is listening to the instructions")) }) .WithCharacterRoutines(new CharacterRoutineType[] { CharacterRoutineType.Create(CharacterRoutineTypeName.Sing) }); return(blueprint); }
private static RoomObjectBlueprint GuitarBlueprint() { RoomObjectBlueprint blueprint = new RoomObjectBlueprint(RoomObjectName.Guitar) .WithName("Guitar") .WithMenuDescription("A mean guitar") .WithPrice(5) .WithObjectInteractions(new ObjectInteraction[] { ObjectInteraction.Create(ObjectInteractionType.Perform, "Guitar plays itself") .AddInteractionStep(InteractionStep.Create().WithSequenceLine("It is a self-playing guitar")), ObjectInteraction.Create(ObjectInteractionType.Perform, "Play guitar", ObjectInteractionCharacterRole.CharacterAtRoomObject) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("A mean guitar")), ObjectInteraction.Create(ObjectInteractionType.Practice, "Learn playing the guitar", ObjectInteractionCharacterRole.CharacterInRoom) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("Our hero hopes he will be as good Jimmy Hendrix one day.")) }); return(blueprint); }
private static RoomObjectBlueprint MixPanelBlueprint() { RoomObjectBlueprint blueprint = new RoomObjectBlueprint(RoomObjectName.MixPanel) .WithName("Mix panel") .WithMenuDescription("Turn everything up to 11") .WithObjectInteractions(new ObjectInteraction[] { ObjectInteraction.Create(ObjectInteractionType.Record, "Remix", ObjectInteractionCharacterRole.CharacterAtRoomObject) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("The song now sounds even better")), ObjectInteraction.Create(ObjectInteractionType.Record, "Record song", ObjectInteractionCharacterRole.CharacterAtRoomObject) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("A new song was recorded")) }) .WithCharacterRoutines(new CharacterRoutineType[] { }); return(blueprint); }
private static RoomObjectBlueprint PianoBlueprint() { RoomObjectBlueprint blueprint = new RoomObjectBlueprint(RoomObjectName.Piano) .WithName("Piano") .WithMenuDescription("Be more like Mozart") .WithPrice(15) .WithObjectInteractions(new ObjectInteraction[] { ObjectInteraction.Create(ObjectInteractionType.Perform, "Self-play") .AddInteractionStep(InteractionStep.Create().WithSequenceLine("It is a self-playing piano")), ObjectInteraction.Create(ObjectInteractionType.Perform, "Perform", ObjectInteractionCharacterRole.CharacterAtRoomObject) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("Our hero is playing the guitar")), ObjectInteraction.Create(ObjectInteractionType.Practice, "Practice", ObjectInteractionCharacterRole.CharacterInRoom) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("Our hero hopes he will play as Rachmaninov one day.")), ObjectInteraction.Create(ObjectInteractionType.Repair, "Repair", ObjectInteractionCharacterRole.CharacterAtRoomObject) .AddInteractionStep(InteractionStep.Create().WithSequenceLine("The piano is no longer broken!")) }); return(blueprint); }
private static RoomObjectBlueprint TelephoneBlueprint() { RoomObjectBlueprint blueprint = new RoomObjectBlueprint(RoomObjectName.Telephone) .WithName("Telephone") .WithMenuDescription("A classic black telephone") .WithObjectInteractions(new ObjectInteraction[] { ObjectInteraction.Create(ObjectInteractionType.Contact, "Call the police") .AddInteractionStep(InteractionStep.Create().WithSequenceLine("You asked the police to removed the loud, beared hippies from your studio")), ObjectInteraction.Create(ObjectInteractionType.Contact, "Order a pizza") .AddInteractionStep(InteractionStep.Create().WithSequenceLine("You ordered a pizza for the whole band")), ObjectInteraction.Create(ObjectInteractionType.Contact, "Organise a tour") .AddInteractionStep(InteractionStep.Create().WithSequenceLine("The band is going on tour again!")) }) .WithCharacterRoutines(new CharacterRoutineType[] { CharacterRoutineType.Create(CharacterRoutineTypeName.MakePhoneCall) }); return(blueprint); }
private void ShowEmptyOptionsMenu() { Logger.Warning(Logger.Interaction, "not a single character in the game can currently interact with {0}. We need to set up something for this case", RoomObject.RoomObject.RoomObjectName); ObjectInteraction emptyInteraction = ObjectInteraction.Create(ObjectInteractionType.Empty, "There is no one in the studio who can interact with the " + RoomObject.RoomObjectBlueprint.Name, ObjectInteractionCharacterRole.NoCharacter); GameObject InteractionOptionGO = Instantiate(ObjectInteractionOptionsContainerGO.InteractionOptionPrefab, InteractionOptionsContainer.transform); InteractionOptionGO.name = emptyInteraction.Name; Logger.Log(Logger.Interaction, "Display empty interaction meny"); ObjectInteractionOptionType optionType = ObjectInteractionOptionType.InteractionStarter; ObjectInteractionOptionButton objectInteractionOptionButton = CreateInteractionOptionButton(InteractionOptionGO, 0, ObjectInteractionOptions.Length); _objectInteractionOptionButtons.Add(objectInteractionOptionButton); objectInteractionOptionButton.Initialise(emptyInteraction, RoomObject, optionType); objectInteractionOptionButton.SetInteractionOptionText(emptyInteraction.Name); }