mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-28 08:07:59 +01:00
commit
6facb2e301
3205 changed files with 965995 additions and 59 deletions
229
Assets/Cinema Director/ChangeLog.txt
Normal file
229
Assets/Cinema Director/ChangeLog.txt
Normal file
|
@ -0,0 +1,229 @@
|
|||
v1.4.6.2
|
||||
=============
|
||||
Bug Fix: (Unity 2017.2) More curve fixes.
|
||||
|
||||
v1.4.6.1
|
||||
=============
|
||||
Bug Fix: (Unity 2017.2) Additional fixes for issue with rotation curves.
|
||||
|
||||
v1.4.6.0
|
||||
=============
|
||||
Bug Fix: (Unity 2017.2) Fixes for issue with rotation curves that prevented having keyframes go beyond 360 degrees.
|
||||
Bug Fix: Updated code for Unity 2017.
|
||||
Added: Updated our 3rd Party support for Cinemachine 2.
|
||||
Added: User-submitted Crossfade event, found under the Third Party folder.
|
||||
|
||||
v1.4.5.4
|
||||
=============
|
||||
Bug Fix: Fixed issue where using the 'Snap Scrubber' when not in preview mode would cause your actor's initial state to be altered to the state at the time you snapped to, causes them to revert to this state after leaving Preview Mode instead of reverting back to their state before the cutscene.
|
||||
Bug Fix: Fixed issue with the Skip cutscene logic.
|
||||
Bug Fix: The changes made in our Unity 5.5 version of Director are now included in our regular versions (4.6.1 & 5.0.4), and should only load when necessary. This means we don't need a 5.5 specific upload for these changes.
|
||||
|
||||
v1.4.5.3
|
||||
=============
|
||||
Bug Fix: Fixed issue where some .DLLs would interfere and break the Director window. Now also prints a debug message telling the user which .DLL is causing the issue.
|
||||
Bug Fix: Fixed a styling issue in Unity 5.5 caused by the renaming of an internal editor style.
|
||||
Bug Fix: Missed some resource loading calls for our GUI.
|
||||
Bug Fix: Fixed issue where clicking the 'Add New Action' button in the Global Item Track's inspector would throw an error.
|
||||
Bug Fix: Cleaned up various warnings when using various versions of Unity.
|
||||
Added: A new timeline item the change an object's texture.
|
||||
|
||||
v1.4.5.2
|
||||
=============
|
||||
Added: New folder structure; About window, documentation, and examples are now separate from the core product folders, and can be safetly deleted.
|
||||
Added: Editor GUI icon images moved to special Unity folder, "Editor Default Resources". Our icons in this folder will automatically no longer be included in your builds.
|
||||
Added: Additional options to the Director window's create drop-down (Default Cutscene, Empty Cutscene, New Cutscene Trigger) to help get up and running with a few less clicks.
|
||||
Bug Fix: Cinemachine Integration - Changed the CinemachineShot item to only accept current and future Cinemachine cameras.
|
||||
Bug Fix: Curve Clip no longer throws errors when right-clicking them if the actor has a missing script attached.
|
||||
Bug Fix: Updated a few scripts to work with Unity 5.4
|
||||
|
||||
v1.4.5.1
|
||||
=============
|
||||
Bug Fix: Cinemachine Integration - CinemachineShots should now properly blend.
|
||||
Bug Fix: The Looping and Skippable checkboxes in the Cutscene Creator should now work.
|
||||
Bug Fix: Missing GUI icons should no longer freeze Director and have it throw exceptions.
|
||||
Bug Fix: Some items such as SetPosition should now properly revert.
|
||||
Added: SetRotation and SetScale timeline actions.
|
||||
Added: CutsceneStarted event, subscribe to it to call a method when a cutscene starts.
|
||||
|
||||
v1.4.5.0
|
||||
=============
|
||||
Added: Cinemachine Integration.
|
||||
Added: Can now create RevertInfo objects that call methods with any number of parameters.
|
||||
Added: Tracks can now be locked. Locked tracks cannot be edited.
|
||||
Bug Fix: Cutscene items should now properly Trigger/End once, regardless if they are at the start/end of a cutscene, in play/edit mode, or if the cutscene is looped.
|
||||
Bug Fix: Cutscene items should now properly cache their states before the cutscene is previewed/played, and will now proplery revert to their initial states.
|
||||
Bug Fix: Curves can now work with integer values. Curves will still display floating point numbers, but will round them before being applied. (X.5 will round to nearest even integer)
|
||||
Bug Fix: Actor item tracks will now pause any pausable items.
|
||||
Bug Fix: Cutscenes now play when being built to UWP with master build settings.
|
||||
|
||||
v1.4.4.0
|
||||
=============
|
||||
Added: Events to manipulate uGUI elements.
|
||||
Added: Custom inspector for the SendMessage event, allowing the user to select the type and value of the parameter they wish to pass to the specified method.
|
||||
Bug Fix: Fixed issue preventing Cutscenes from being played in UWP.
|
||||
Bug Fix: Rotation curves no longer create keyframes while scrubbing in preview mode.
|
||||
Bug Fix: Fixed issue where the "Play Animation" action would not allow for clip length to be trimmed.
|
||||
Bug Fix: Implemented SetParent event.
|
||||
Bug Fix: Fixed issue where events would not trigger during consecutive plays of a cutscene if the firetime was set to 0.
|
||||
|
||||
v1.4.3.0
|
||||
=============
|
||||
Added: New help window.
|
||||
Added: link.xml file to help with builds for iOS.
|
||||
Fixed: Bug where demo scene was sometime crashing due to revert info problems.
|
||||
Fixed: Bug in Unity 5.3 where Cutscene could no longer find parents in hierarchy. This temporary fix means the Cutscene hierarchy must be strictly followed.
|
||||
|
||||
v1.4.2.1
|
||||
=============
|
||||
Cutscene will take the necessary time to initialize (if not called beforehand) on Play, before beginning playback. This helps avoid some lag at the beginning of playback.
|
||||
When editing curves, changes take effect immediately on target actor, instead of waiting for mouse-up.
|
||||
Fixed bug where "Add Key" option was no longer working.
|
||||
Can now build to NETFX_CORE.
|
||||
Load Level Event now has options for additive, async, additive+async and to load by index or name.
|
||||
|
||||
v1.4.1.0
|
||||
=============
|
||||
Track Groups and Tracks' collapsed state is maintained between sessions.
|
||||
Fixed bug where Unity 4.6 users couldn't open demo scene.
|
||||
Fixed one scenario where CharacterTrackGroup was causing Unity to crash.
|
||||
Added Settings Window.
|
||||
Added ability to toggle Beta Features in settings panel. Users who wish to try out new features at the risk of loss of stability can opt to enable them.
|
||||
|
||||
v1.4.0.6
|
||||
=============
|
||||
Playmaker integration.
|
||||
NodeCanvas integration.
|
||||
Sidebar can now be re-sized.
|
||||
Game Objects can now be dragged from the Hierarchy panel into the Director panel to create an Actor Track Group.
|
||||
Track Groups and Tracks can now be renamed/duplicated/deleted in the Director panel by context clicking label.
|
||||
Shift/Ctrl select now multi-selects items in sidebar.
|
||||
Added box-select in working area for timeline items.
|
||||
Ctrl-select now toggles timeline item selection.
|
||||
Added the ability to move multiple selected timeline items.
|
||||
Context clicking in an empty track space now presents Add menu and newly created items are added at that time.
|
||||
Fixed bug where Cutscene sometimes didn't start from time 0.
|
||||
Added option to open the Director panel from Cutscene's inspector, focusing the selected Cutscene.
|
||||
Double-clicking a Curve Clip toggles it between edit mode and done.
|
||||
|
||||
v1.3.4.0
|
||||
=============
|
||||
Scroll wheel now controls vertical scroll. Ctrl+scroll now controls zoom (Can also zoom with alt+right click+mouse move).
|
||||
Updated Resources folder to stop conflicts with other extensions, by adding Director_ prefix to most assets.
|
||||
Added TransformLookAtAction.
|
||||
Made Cutscene.state non-serialized.
|
||||
|
||||
v1.3.3.1
|
||||
=============
|
||||
Quick Fix: Cutscene drop down selector now correlates to the proper cutscene.
|
||||
|
||||
v1.3.3.0
|
||||
=============
|
||||
Solved issue where edit-mode playback speed was slower than real time.
|
||||
Fixed fade to black transitions for Unity5.
|
||||
Fixed problem where audio playback wasn't exact in preview mode.
|
||||
Fixed issue in Unity5 where error was shown for setting incorrect audio time values.
|
||||
Cutscenes in dropdown selector are now shown alphabetically.
|
||||
Added Transform Track for Character Track Groups.
|
||||
Curve Editor: Tangent Mode is now maintained through sessions.
|
||||
Curve Editor: When Keyframes are alered/deleted/added, neighbours are updated according to tangent mode automatically.
|
||||
Curve Editor: Changing tangent mode can now be undone.
|
||||
Curve Editor: Automatic Keyframing can now be undone.
|
||||
Curve Editor: Fixed undo not working in some cases.
|
||||
Curve Editor: Master keys can now be used to delete all children keys.
|
||||
Curve Editor: The threshold for altering auto key values has now been changed to 0.000001
|
||||
|
||||
v1.3.2.0
|
||||
=============
|
||||
Support for Behavior Designer.
|
||||
Added timecode to toolbar.
|
||||
GC Alloc for the Cutscene behaviour is now 0.
|
||||
Fixed issue where scrubber wouldn't work after exiting playmode in Unity5.
|
||||
Audio items now adapt when audio clips are changed in the AudioSource component.
|
||||
Fixed error when prefab cutscenes are added to the scene.
|
||||
Fixed error where editing curve items was not possible when the Actor for the track group was not set.
|
||||
|
||||
v1.3.1.1
|
||||
=============
|
||||
Unity 5 Compatability.
|
||||
Current selected Cutscene in Director panel is maintained between playmode changes.
|
||||
|
||||
v1.3.0.4
|
||||
=============
|
||||
New Character Track Group, made specifically for Humanoid characters.
|
||||
New Mecanim Track for controlling AnimationControllers and allowing mecanim animation previewing in Edit Mode.
|
||||
New Dialogue Track for Character Track Groups.
|
||||
All events/actions that manipulate scene data now have Revert options for both editor and runtime mode.
|
||||
Manually skipping/jumping to frames now handles cases where multiple tracks reference the same data.
|
||||
Cutscene.Optimize() is a new method that should be called during scene load, to cache all cutscene components for fast execution.
|
||||
Cutscene.Skip() implemented. CutsceneTrigger now has an option for Skipping. Default to "Jump" (Space bar by default).
|
||||
Cutscene can now be set to loop. Make sure to setup the ability to skip!
|
||||
New selector button on Director toolbar to quickly select current Cutscene.
|
||||
New refresh button, to re-bake all Mecanim previews.
|
||||
Keyframe tangent handles now look different than Keyframes.
|
||||
The 'Create' button now looks up any custom made Track Group and adds it to the list.
|
||||
The play button in the toolbar now works when in runtime as a method to trigger the Cutscene to play.
|
||||
|
||||
Added DirectorRuntimeHelper.cs, a helper class for determining which tracks and track items belong to their proper parents.
|
||||
Added TimelineTrackAttribute, attribute for tracks to define which track group it belongs to and what type of track items it can hold.
|
||||
Added TrackGroupAttribute, an attribute for track groups to define which types of tracks it can hold
|
||||
Added RevertInfo.cs, used to capture state data of any item manipulated by the Cutscene.
|
||||
Added IBakeable, to be implemented in any track/item that needs to be baked and used for previewing.
|
||||
Added IOptimizable, to be implemented in any track/item that needs to perform some optimization process on Cutscene load.
|
||||
Added IRevertable, to be implemented in any track/item that manipulates scene data.
|
||||
Added IActorTrack.cs, to be implemented by any extended track that manipulates an Actor.
|
||||
Added IMultiActorTrack.cs, to be implemented by any extended track that manipulates multiple actors.
|
||||
Added GenericTrackGroupControl.cs, as an implementation with basic features for a track group control.
|
||||
Added CharacterTrackGroupControl.cs for character track groups.
|
||||
Added GenericTrackControl.cs as an implementation with basic features for track controls (copy/paste/etc).
|
||||
Added DialogueTrackControl.cs for dialogue tracks.
|
||||
Added DialogueTrackInspector.cs
|
||||
Added CutsceneControlHelper.cs, as a helper class for Cutscene Controls.
|
||||
Added new method SetDefaults() to TimelineItem.cs, override to set defaults to newly created items.
|
||||
Deleted ActorTrack.cs. No longer necessary with TrackAttributes.
|
||||
Deleted GlobalTrack.cs. No longer necessary with TrackAttributes.
|
||||
All existing CutsceneItems have been given a CutsceneItemGenre.
|
||||
All existing Cutscene Items that manipulate data now implement IRevertable.
|
||||
All existing Track Group Controls now inherit from GenericTrackGroupControl.
|
||||
All existing Track Controls now inherit from GenericTrackControl.
|
||||
Added new property EndTime to TimelineAction.cs
|
||||
Fixed issue where audio item control sometimes doesn't show wave form.
|
||||
CutsceneItemFactory now creates Cutscene Items generically.
|
||||
Renamed SetColorLight class name to match filename.
|
||||
Timeline Items no longer need to be a direct child of a Track in the hierarchy, but can be further down in the hierarchy.
|
||||
Tracks no longer need to be a direct child of a TrackGroup in the hierarchy, but can be further down in the hierarchy.
|
||||
|
||||
Suggestions for people with Custom extensions:
|
||||
Custom Cutscene Items should now be given a CutsceneItemGenre in their CutsceneItemAttributes to be assigned to tracks.
|
||||
Custom Cutscene Item should override SetDefaults() which is called when a new instance is created.
|
||||
Custom Cutscene Items that manipulate scene data should implement the IRevertable interface.
|
||||
Custom TrackGroupControls should consider extending from GenericTrackGroupControl.
|
||||
Custom TrackControls shoulder consider extending from GenericTrackControl.
|
||||
Custom Tracks and TrackGroups shoulder consider implementing IOptimizable and caching children data.
|
||||
|
||||
|
||||
|
||||
v1.2.1.2
|
||||
=============
|
||||
Fixed bug Unity Free users were experiencing with editing Curve Clips.
|
||||
|
||||
v1.2.1.1.
|
||||
=============
|
||||
Fancy new ReadMe.txt file!
|
||||
Exciting new Help panel!
|
||||
Timeline library for manipulating other Cutscenes.
|
||||
Fixed bug where undesired keyframes were being added.
|
||||
Fixed bug where you could select non-visible keyframes.
|
||||
Fixed bug where Actors animated through curve clips sometimes return to Origin unexpectedly.
|
||||
Fixed "Enable/Disable Behaviour" to work for any Component that has an "enabled" property.
|
||||
|
||||
v1.2.0.0.
|
||||
=============
|
||||
Copy and Paste for track items.
|
||||
Cutscene.Play() to be implemented as co-routine.
|
||||
Cutscene API improved with callback events.
|
||||
Tick marks in Time Ruler flicker black/white when camera preview is shown.
|
||||
Multi-Actor curve clips were attempting to assign values to properties which were not defined in inspector causing exceptions.
|
||||
In director panel, track headers are not indented to the right of parents.
|
||||
Timeline Items don't trigger on first/last frame of cutscene.
|
||||
"Mass Disable" doesn't turn tagged objects back on.
|
4
Assets/Cinema Director/ChangeLog.txt.meta
Normal file
4
Assets/Cinema Director/ChangeLog.txt.meta
Normal file
|
@ -0,0 +1,4 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f844faee935154e47b81b9f2f6005977
|
||||
TextScriptImporter:
|
||||
userData:
|
5
Assets/Cinema Director/Cutscene Items.meta
Normal file
5
Assets/Cinema Director/Cutscene Items.meta
Normal file
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 26bbd23b0c1c9004e9088dbff58e90fc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
5
Assets/Cinema Director/Cutscene Items/Actor Items.meta
Normal file
5
Assets/Cinema Director/Cutscene Items/Actor Items.meta
Normal file
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a58895460d2a43a458de9e8077c51765
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b3a48675b86e5d1458b6ec177d2eb77c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,31 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animation", "Blend Animation", CutsceneItemGenre.ActorItem)]
|
||||
public class BlendAnimationEvent : CinemaActorEvent
|
||||
{
|
||||
public string Animation = string.Empty;
|
||||
public float TargetWeight = 1f;
|
||||
public float FadeLength = 0.3f;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Animation animation = actor.GetComponent<Animation>();
|
||||
if (!animation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animation.Blend(Animation, TargetWeight, FadeLength);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0f3c5183c6865704888dcc42bf7cfc4a
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,31 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animation", "Cross Fade Animation", CutsceneItemGenre.ActorItem)]
|
||||
public class CrossFadeAnimationEvent : CinemaActorEvent
|
||||
{
|
||||
public string Animation = string.Empty;
|
||||
public float TargetWeight = 1f;
|
||||
public PlayMode PlayMode = PlayMode.StopSameLayer;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Animation animation = actor.GetComponent<Animation>();
|
||||
if (!animation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animation.CrossFade(Animation, TargetWeight, PlayMode);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d694a8b76bf1bdb4d9bb85dc9f0a283a
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,66 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animation", "Play Animation", CutsceneItemGenre.ActorItem)]
|
||||
public class PlayAnimationEvent : CinemaActorAction
|
||||
{
|
||||
public AnimationClip animationClip = null;
|
||||
|
||||
public WrapMode wrapMode;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (wrapMode != WrapMode.Loop && animationClip)
|
||||
base.Duration = animationClip.length;
|
||||
}
|
||||
|
||||
public override void Trigger(GameObject Actor)
|
||||
{
|
||||
Animation animation = Actor.GetComponent<Animation>();
|
||||
if (!animationClip || !animation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animation.wrapMode = wrapMode;
|
||||
//animation.Play(animationClip.name);
|
||||
}
|
||||
|
||||
public override void UpdateTime(GameObject Actor, float runningTime, float deltaTime)
|
||||
{
|
||||
Animation animation = Actor.GetComponent<Animation>();
|
||||
|
||||
if (!animation || animationClip == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (animation[animationClip.name] == null)
|
||||
{
|
||||
animation.AddClip(animationClip, animationClip.name);
|
||||
}
|
||||
|
||||
AnimationState state = animation[animationClip.name];
|
||||
|
||||
if (!animation.IsPlaying(animationClip.name))
|
||||
{
|
||||
animation.wrapMode = wrapMode;
|
||||
animation.Play(animationClip.name);
|
||||
}
|
||||
|
||||
state.time = runningTime;
|
||||
state.enabled = true;
|
||||
animation.Sample();
|
||||
state.enabled = false;
|
||||
}
|
||||
|
||||
public override void End(GameObject Actor)
|
||||
{
|
||||
Animation animation = Actor.GetComponent<Animation>();
|
||||
if (animation)
|
||||
animation.Stop();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 68e1ae1c496bc0b4d86051ae0f8a22b3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,22 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class ReloadLevelStart : MonoBehaviour
|
||||
{
|
||||
|
||||
public AudioMixer masterMixer;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
|
||||
masterMixer.SetFloat("masterVol", 0);
|
||||
|
||||
Application.LoadLevel(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 97b313339f311584996cffa05b5f1051
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,29 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animation", "Rewind Animation", CutsceneItemGenre.ActorItem)]
|
||||
public class RewindAnimationEvent : CinemaActorEvent
|
||||
{
|
||||
public string Animation = string.Empty;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Animation animation = actor.GetComponent<Animation>();
|
||||
if (!animation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animation.Rewind(Animation);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a6e50d9ad3413b446be3a89a81f3e981
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,33 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animation", "Sample Animation", CutsceneItemGenre.ActorItem)]
|
||||
public class SampleAnimationEvent : CinemaActorEvent
|
||||
{
|
||||
public string Animation = string.Empty;
|
||||
public float Time = 0f;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Animation animation = actor.GetComponent<Animation>();
|
||||
if (!animation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animation[Animation].time = Time;
|
||||
animation[Animation].enabled = true;
|
||||
animation.Sample();
|
||||
animation[Animation].enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2b7e5cf5bb9bac949a553537e6242ccb
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,29 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animation", "Stop Animation", CutsceneItemGenre.ActorItem)]
|
||||
public class StopAnimationEvent : CinemaActorEvent
|
||||
{
|
||||
public string Animation = string.Empty;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Animation animation = actor.GetComponent<Animation>();
|
||||
if (!animation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animation.Stop(Animation);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a4262f74c2654f74c96e1f7f5bdfd514
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e3a26f05c7c9ce44290196673ca45b5e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,25 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Cross Fade Animator", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class CrossFadeAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public string AnimationStateName = string.Empty;
|
||||
public float TransitionDuration = 1f;
|
||||
public int Layer = -1;
|
||||
float NormalizedTime = float.NegativeInfinity;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.CrossFade(AnimationStateName, TransitionDuration, Layer, NormalizedTime);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eac17bef6b45d5643947c61fccec8257
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,50 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Look At Target", CutsceneItemGenre.ActorItem)]
|
||||
public class LookAtTarget : CinemaActorAction
|
||||
{
|
||||
public Transform LookAtPosition;
|
||||
|
||||
public float Weight;
|
||||
public float BodyWeight = 0f;
|
||||
public float HeadWeight = 1f;
|
||||
public float EyesWeight = 0f;
|
||||
public float ClampWeight = 0.5f;
|
||||
|
||||
public override void Trigger(GameObject Actor)
|
||||
{
|
||||
Animator animator = Actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetLookAtPosition(LookAtPosition.position);
|
||||
}
|
||||
|
||||
|
||||
public override void UpdateTime(GameObject Actor, float runningTime, float deltaTime)
|
||||
{
|
||||
Animator animator = Actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetLookAtPosition(LookAtPosition.position);
|
||||
animator.SetLookAtWeight(Weight, BodyWeight, HeadWeight, EyesWeight, ClampWeight);
|
||||
}
|
||||
|
||||
public override void End(GameObject Actor)
|
||||
{
|
||||
Animator animator = Actor.GetComponent<Animator>();
|
||||
if (animator)
|
||||
{
|
||||
animator.SetLookAtWeight(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a4d689de1a1ecfe4b8af215becc4a44e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,27 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Match Target",CutsceneItemGenre.MecanimItem)]
|
||||
public class MatchTargetEvent : CinemaActorEvent
|
||||
{
|
||||
public GameObject target;
|
||||
public AvatarTarget avatarTarget;
|
||||
public float startTime;
|
||||
public float targetTime;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MatchTargetWeightMask weightMask = new MatchTargetWeightMask(Vector3.one, 0);
|
||||
animator.MatchTarget(target.transform.position, target.transform.rotation, avatarTarget, weightMask, startTime, targetTime);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ff346f0a50707ac4c891c3f186d4758c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,24 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Play Mecanim Animation", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class PlayAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public string StateName;
|
||||
public int Layer = -1;
|
||||
float Normalizedtime = float.NegativeInfinity;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.Play(StateName, Layer, Normalizedtime);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3683488bb6fdb6c4f9184179af5faaab
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,21 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Bool", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetBoolAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public string BoolName;
|
||||
public bool Value = false;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator != null)
|
||||
{
|
||||
animator.SetBool(BoolName, Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ba55441d5ac24242a78750cf55eb17f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Float", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetFloatAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public string FloatName;
|
||||
public float Value = 0f;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetFloat(FloatName, Value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 50ba73e02cee270489e2d9c85cd9ca4f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set IK Position", CutsceneItemGenre.ActorItem)]
|
||||
public class SetIKPositionAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public AvatarIKGoal Goal;
|
||||
public Vector3 GoalPosition;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetIKPosition(Goal, GoalPosition);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7cb6b8221c1b61545971b5f94203d89e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set IK Position Weight", CutsceneItemGenre.ActorItem)]
|
||||
public class SetIKPositionWeightAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public AvatarIKGoal Goal;
|
||||
public float Value;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetIKPositionWeight(Goal, Value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e7e826a7a32b5264d8bf544882d9a49f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set IK Rotation", CutsceneItemGenre.ActorItem)]
|
||||
public class SetIKRotationAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public AvatarIKGoal Goal;
|
||||
public Quaternion GoalRotation;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetIKRotation(Goal, GoalRotation);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0e170bc7aafcbbb4d8bb573276eb0a4f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set IK Rotation Weight", CutsceneItemGenre.ActorItem)]
|
||||
public class SetIKRotationWeightAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public AvatarIKGoal Goal;
|
||||
public float Value;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetIKRotationWeight(Goal, Value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7b7ade7af9e0a0f4ea1d622472408879
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Integer", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetIntegerAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public string IntName;
|
||||
public int Value = 0;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetInteger(IntName, Value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 408a9e082a395b948b3cac6e991ae341
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Layer Weight", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetLayerWeightAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public int LayerIndex;
|
||||
public float Weight = 0f;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetLayerWeight(LayerIndex, Weight);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 00caaf5aeea0bc045936a059b817d778
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,22 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Look At Position", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetLookAtPositionAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public Transform LookAtPosition;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetLookAtPosition(LookAtPosition.position);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b90bac225ed7c2340a7d0911569d5018
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,26 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Look At Weight", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetLookAtWeightAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public float Weight;
|
||||
public float BodyWeight = 0f;
|
||||
public float HeadWeight = 1f;
|
||||
public float EyesWeight = 0f;
|
||||
public float ClampWeight = 0.5f;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetLookAtWeight(Weight, BodyWeight, HeadWeight, EyesWeight, ClampWeight);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b7ff3238f7db62843849f479828f2faa
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Target", CutsceneItemGenre.ActorItem)]
|
||||
public class SetTargetAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public AvatarTarget TargetIndex;
|
||||
public float TargetNormalizedTime;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetTarget(TargetIndex, TargetNormalizedTime);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 025b25e38a6c7a1409b3a79854e1987e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,22 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Animator", "Set Trigger", CutsceneItemGenre.ActorItem, CutsceneItemGenre.MecanimItem)]
|
||||
public class SetTriggerAnimatorEvent : CinemaActorEvent
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Animator animator = actor.GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animator.SetTrigger(Name);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cf3feabd4a1df584ea17f311e94e2a2e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d4cb51eb32b63d640a179d1f0486206a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Audio Source", "Pause Audio", CutsceneItemGenre.ActorItem)]
|
||||
public class PauseAudioEvent : CinemaActorEvent
|
||||
{
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
AudioSource audio = actor.GetComponent<AudioSource>();
|
||||
if (!audio)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
audio.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 07200f278b47f704abf8a0f10ae29519
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,94 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Audio Source", "Play Audio", CutsceneItemGenre.ActorItem)]
|
||||
public class PlayAudioEvent : CinemaActorAction
|
||||
{
|
||||
public AudioClip audioClip = null;
|
||||
public bool loop = false;
|
||||
|
||||
private bool wasPlaying = false;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!loop && audioClip)
|
||||
Duration = audioClip.length;
|
||||
else
|
||||
Duration = -1;
|
||||
}
|
||||
|
||||
public override void Trigger(GameObject Actor)
|
||||
{
|
||||
AudioSource audio = Actor.GetComponent<AudioSource>();
|
||||
if (!audio)
|
||||
{
|
||||
audio = Actor.AddComponent<AudioSource>();
|
||||
audio.playOnAwake = false;
|
||||
}
|
||||
|
||||
if (audio.clip != audioClip)
|
||||
audio.clip = audioClip;
|
||||
|
||||
audio.time = 0.0f;
|
||||
audio.loop = loop;
|
||||
audio.Play();
|
||||
}
|
||||
|
||||
public override void UpdateTime(GameObject Actor, float runningTime, float deltaTime)
|
||||
{
|
||||
AudioSource audio = Actor.GetComponent<AudioSource>();
|
||||
if (!audio)
|
||||
{
|
||||
audio = Actor.AddComponent<AudioSource>();
|
||||
audio.playOnAwake = false;
|
||||
}
|
||||
|
||||
if (audio.clip != audioClip)
|
||||
audio.clip = audioClip;
|
||||
|
||||
if (audio.isPlaying)
|
||||
return;
|
||||
|
||||
audio.time = deltaTime;
|
||||
|
||||
|
||||
audio.Play();
|
||||
|
||||
}
|
||||
|
||||
public override void Resume(GameObject Actor)
|
||||
{
|
||||
AudioSource audio = Actor.GetComponent<AudioSource>();
|
||||
if (!audio)
|
||||
return;
|
||||
|
||||
audio.time = Cutscene.RunningTime - Firetime;
|
||||
|
||||
if (wasPlaying)
|
||||
audio.Play();
|
||||
}
|
||||
|
||||
public override void Pause(GameObject Actor)
|
||||
{
|
||||
AudioSource audio = Actor.GetComponent<AudioSource>();
|
||||
|
||||
wasPlaying = false;
|
||||
if (audio && audio.isPlaying)
|
||||
wasPlaying = true;
|
||||
|
||||
if (audio)
|
||||
audio.Pause();
|
||||
}
|
||||
|
||||
public override void End(GameObject Actor)
|
||||
{
|
||||
AudioSource audio = Actor.GetComponent<AudioSource>();
|
||||
if (audio)
|
||||
audio.Stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7325078cc186f574684607acb59901e1
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,28 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Audio Source", "Play One Shot", CutsceneItemGenre.ActorItem)]
|
||||
public class PlayOneShotAudioEvent : CinemaActorEvent
|
||||
{
|
||||
public AudioClip Clip;
|
||||
public float VolumeScale = 1f;
|
||||
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
AudioSource audio = actor.GetComponent<AudioSource>();
|
||||
if (!audio)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
audio.PlayOneShot(Clip, VolumeScale);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2630293c17e32d146836819265374047
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
[CutsceneItemAttribute("Audio Source", "Stop Audio", CutsceneItemGenre.ActorItem)]
|
||||
public class StopAudioEvent : CinemaActorEvent
|
||||
{
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
AudioSource audio = actor.GetComponent<AudioSource>();
|
||||
if (!audio)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
audio.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6d320cdb68d39e14893bd6371a680a57
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aebb5a7d4b22fad4998602a33e901775
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,70 @@
|
|||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An Event for disabling any behaviour that has an "enabled" property.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Game Object", "Disable Behaviour", CutsceneItemGenre.ActorItem)]
|
||||
public class DisableBehaviour : CinemaActorEvent
|
||||
{
|
||||
public Component Behaviour;
|
||||
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and Disable the chosen Behaviour.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to perform the behaviour disable on.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Component b = actor.GetComponent(Behaviour.GetType()) as Component;
|
||||
if (b != null)
|
||||
{
|
||||
Behaviour.GetType().GetMember("enabled");
|
||||
|
||||
PropertyInfo fieldInfo = Behaviour.GetType().GetProperty("enabled");
|
||||
fieldInfo.SetValue(Behaviour, false, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse trigger this event and Enable the chosen Behaviour.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to perform the behaviour enable on.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
Component b = actor.GetComponent(Behaviour.GetType()) as Component;
|
||||
if (b != null)
|
||||
{
|
||||
PropertyInfo fieldInfo = Behaviour.GetType().GetProperty("enabled");
|
||||
fieldInfo.SetValue(b, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aacd68dc9407b5f49ae49ac4a45267f8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,82 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An Actor event for disabling the Actor
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Game Object", "Disable", CutsceneItemGenre.ActorItem)]
|
||||
public class DisableGameObject : CinemaActorEvent, IRevertable
|
||||
{
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null)
|
||||
{
|
||||
reverts.Add(new RevertInfo(this, go.gameObject, "SetActive", go.gameObject.activeSelf));
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and disable the given actor.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to be disabled.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse the event by settings the game object to the previous state.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor whose active state will be reversed.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(true); // ToDo: Implement reversing with cacheing previous state.
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 45a64e88ccdf4ca44b2f4cb2114f88da
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,99 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An Event for enabling any behaviour that has an "enabled" property.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Game Object", "Enable Behaviour", CutsceneItemGenre.ActorItem)]
|
||||
public class EnableBehaviour : CinemaActorEvent, IRevertable
|
||||
{
|
||||
// The Component/Behaviour to Enable.
|
||||
public Component Behaviour;
|
||||
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns>All the revert info related to this event.</returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null)
|
||||
{
|
||||
Component b = go.GetComponent(Behaviour.GetType()) as Component;
|
||||
if (b != null)
|
||||
{
|
||||
PropertyInfo pi = Behaviour.GetType().GetProperty("enabled");
|
||||
bool value = (bool)pi.GetValue(b, null);
|
||||
|
||||
reverts.Add(new RevertInfo(this, Behaviour, "enabled", value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and Enable the chosen Behaviour.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to perform the behaviour enable on.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Component b = actor.GetComponent(Behaviour.GetType()) as Component;
|
||||
if (b != null)
|
||||
{
|
||||
Behaviour.GetType().GetMember("enabled");
|
||||
|
||||
PropertyInfo fieldInfo = Behaviour.GetType().GetProperty("enabled");
|
||||
fieldInfo.SetValue(Behaviour, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse trigger this event and Disable the chosen Behaviour.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to perform the behaviour disable on.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
Component b = actor.GetComponent(Behaviour.GetType()) as Component;
|
||||
if (b != null)
|
||||
{
|
||||
PropertyInfo fieldInfo = Behaviour.GetType().GetProperty("enabled");
|
||||
fieldInfo.SetValue(b, false, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 937b9eb698794dd4bba21a2b0979a901
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,82 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable the Actor related to this event.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Game Object", "Enable", CutsceneItemGenre.ActorItem)]
|
||||
public class EnableGameObject : CinemaActorEvent, IRevertable
|
||||
{
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns>All the revert info related to this event.</returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null)
|
||||
{
|
||||
reverts.Add(new RevertInfo(this, go.gameObject, "SetActive", go.gameObject.activeSelf));
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable the given actor.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to be enabled.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse this triggered event and place the actor back in it's previous state.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(false); // ToDo: Implement reversing with cacheing previous state.
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 449468d1ced06564a8786a9426c6fe68
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,114 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable the Actor related to this event.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Game Object", "Temporary Enable", CutsceneItemGenre.ActorItem)]
|
||||
public class EnableGameObjectAction : CinemaActorAction, IRevertable
|
||||
{
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns>All the revert info related to this event.</returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null)
|
||||
{
|
||||
reverts.Add(new RevertInfo(this, go.gameObject, "SetActive", go.gameObject.activeSelf));
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable the given actor temporarily.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to be enabled.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End the action and disable the game object.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor.</param>
|
||||
public override void End(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The trigger time has been hit while playing in reverse. disable the action.
|
||||
/// </summary>
|
||||
/// <param name="Actor">The actor to disable</param>
|
||||
public override void ReverseTrigger(GameObject Actor)
|
||||
{
|
||||
this.End(Actor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The end time has been hit while playing in reverse. enable the action.
|
||||
/// </summary>
|
||||
/// <param name="Actor">The actor to enable</param>
|
||||
public override void ReverseEnd(GameObject Actor)
|
||||
{
|
||||
Trigger(Actor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the action to an arbitrary time.
|
||||
/// </summary>
|
||||
/// <param name="Actor">The current actor.</param>
|
||||
/// <param name="time">the running time of the action</param>
|
||||
/// <param name="deltaTime">The deltaTime since the last update call.</param>
|
||||
public override void SetTime(GameObject actor, float time, float deltaTime)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SetActive(time >= 0 && time < Duration);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 583d7ed8fdca89a41a2161926b0f9c45
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,29 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An event for calling the game object send message method.
|
||||
/// Cannot be reversed.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Game Object", "Send Message", CutsceneItemGenre.ActorItem)]
|
||||
public class SendMessageGameObject : CinemaActorEvent
|
||||
{
|
||||
public string MethodName = string.Empty;
|
||||
public object Parameter = null;
|
||||
public SendMessageOptions SendMessageOptions = SendMessageOptions.DontRequireReceiver;
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and send the message.
|
||||
/// </summary>
|
||||
/// <param name="actor">the actor to send the message to.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
actor.SendMessage(MethodName, Parameter, SendMessageOptions);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cc5e0a476ab20344cbe5a6de035967b1
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0a8d49f3c481f3841b4b29efb9ea662a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,113 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Set the colour of a light component of a given actor.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Light", "Set Light Colour", CutsceneItemGenre.ActorItem)]
|
||||
public class SetLightColour : CinemaActorEvent, IRevertable
|
||||
{
|
||||
// The new color.
|
||||
public Color Color;
|
||||
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
private Color previousColor;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null )
|
||||
{
|
||||
Light light = go.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
reverts.Add(new RevertInfo(this, light, "color", light.color));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize and save the original colour state.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to initialize the light colour with.</param>
|
||||
public override void Initialize(GameObject actor)
|
||||
{
|
||||
Light light = actor.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
previousColor = light.color;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and change the Color of a given actor's light component.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor with the light component to be altered.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Light light = actor.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
previousColor = light.color;
|
||||
light.color = Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse setting the light colour.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to reverse the light setting on.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Light light = actor.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
light.color = previousColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ddfba2783b7e49e4aa0678ffbe4ec4f2
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,107 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Set the intensity of a light component of a given actor.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Light", "Set Intensity", CutsceneItemGenre.ActorItem)]
|
||||
public class SetIntensityLight : CinemaActorEvent, IRevertable
|
||||
{
|
||||
// The new intensity to be set.
|
||||
public float Intensity;
|
||||
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
private float previousIntensity;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null)
|
||||
{
|
||||
Light light = go.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
reverts.Add(new RevertInfo(this, light, "intensity", light.intensity));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize and save the original intensity state.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to initialize the light intensity with.</param>
|
||||
public override void Initialize(GameObject actor)
|
||||
{
|
||||
Light light = actor.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
previousIntensity = light.intensity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and change the intensity of a given actor's light component.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor with the light component to be altered.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Light light = actor.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
previousIntensity = light.intensity;
|
||||
light.intensity = Intensity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse setting the light intensity.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to reverse the light setting on.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
Light light = actor.GetComponent<Light>();
|
||||
if (light != null)
|
||||
{
|
||||
light.intensity = previousIntensity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 96e4258c397fddd4d94575eb12818ed0
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ebdb208a3f19b374cafc2e565aad5a5c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,29 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An event for setting a navigation destination.
|
||||
/// Only executes in runtime. Not reversable.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Navigation", "Set Destination", CutsceneItemGenre.ActorItem)]
|
||||
public class SetDestinationEvent : CinemaActorEvent
|
||||
{
|
||||
// The destination target
|
||||
public Vector3 target;
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and set a new destination.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor with a NavMeshAgent to set a new destination for.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
NavMeshAgent agent = actor.GetComponent<NavMeshAgent>();
|
||||
if (agent != null)
|
||||
{
|
||||
agent.SetDestination(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cda6033a0d7d81943b6ed92293d137a5
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d87c41905647b4d4694feccd33047391
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,29 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable the Actor related to this event.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Particle System", "Pause", CutsceneItemGenre.ActorItem)]
|
||||
public class PauseParticleSystemEvent : CinemaActorEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Trigger this event and pause the particle system component.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to be triggered.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
ParticleSystem ps = actor.GetComponent<ParticleSystem>();
|
||||
if (ps != null)
|
||||
{
|
||||
ps.Pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 59f01268b291fe54ca0fea47febbb63c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,45 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable the Actor related to this event.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Particle System", "Play", CutsceneItemGenre.ActorItem)]
|
||||
public class PlayParticleSystemEvent : CinemaActorEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Trigger the particle system to play.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to be triggered.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
ParticleSystem ps = actor.GetComponent<ParticleSystem>();
|
||||
if (ps != null)
|
||||
{
|
||||
ps.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse this event and stop the particle system.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to reverse this event on.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
ParticleSystem ps = actor.GetComponent<ParticleSystem>();
|
||||
if (ps != null)
|
||||
{
|
||||
ps.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5793536dba5d97047b7a26b997fabae8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,45 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable the Actor related to this event.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Particle System", "Stop", CutsceneItemGenre.ActorItem)]
|
||||
public class StopParticleSystemEvent : CinemaActorEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Trigger the particle system to stop.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to be triggered.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
ParticleSystem ps = actor.GetComponent<ParticleSystem>();
|
||||
if (ps != null)
|
||||
{
|
||||
ps.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse this event and play the particle system.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to reverse this event on.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
ParticleSystem ps = actor.GetComponent<ParticleSystem>();
|
||||
if (ps != null)
|
||||
{
|
||||
ps.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0fbd9802c0eb8349b0a15120ef98e34
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5072097751c8aa34ab8a4b6be550a7bf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -0,0 +1,35 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An Event for applying force to a rigidbody.
|
||||
/// Can only be triggered in Runtime.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Physics", "Apply Force", CutsceneItemGenre.ActorItem)]
|
||||
public class ApplyForceEvent : CinemaActorEvent
|
||||
{
|
||||
// The amount of Force.
|
||||
public Vector3 Force = Vector3.forward;
|
||||
|
||||
// The Force Mode of the add force action.
|
||||
public ForceMode ForceMode = ForceMode.Impulse;
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and Apply force to the RigidBody component of the Actor
|
||||
/// </summary>
|
||||
/// <param name="actor">The Actor of the RigidBody</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Rigidbody affectedObjectRigidBody = actor.GetComponent<Rigidbody>();
|
||||
|
||||
if (affectedObjectRigidBody != null)
|
||||
{
|
||||
affectedObjectRigidBody.AddForce(Force, ForceMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9df18f58265dc5b4281a9a1c24606b66
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,34 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An Event for applying torque to a rigidbody.
|
||||
/// Can only be triggered in Runtime.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Physics", "Apply Torque", CutsceneItemGenre.ActorItem)]
|
||||
public class ApplyTorqueEvent : CinemaActorEvent
|
||||
{
|
||||
// The Torque to be applied
|
||||
public Vector3 Torque = Vector3.forward;
|
||||
|
||||
// the ForceMode
|
||||
public ForceMode ForceMode = ForceMode.Impulse;
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and apple torque to the RigidBody component of the Actor
|
||||
/// </summary>
|
||||
/// <param name="actor">The Actor with a RigidBody to apply to torque to.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Rigidbody affectedObjectRigidBody = actor.GetComponent<Rigidbody>();
|
||||
if (affectedObjectRigidBody != null)
|
||||
{
|
||||
affectedObjectRigidBody.AddTorque(Torque, ForceMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f7b2c3e68a2a1234dbe7fbc234225b63
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,43 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Event to set the rigidbody of a given actor into sleep mode.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Physics", "Sleep", CutsceneItemGenre.ActorItem)]
|
||||
public class RigidbodySleepEvent : CinemaActorEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Trigger this event and set the rigidbody of the actor to sleep.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to put to sleep.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Rigidbody rb = actor.GetComponent<Rigidbody>();
|
||||
if (rb != null)
|
||||
{
|
||||
rb.Sleep();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and wake up the rigidbody component of the given actor.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to wake up.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
Rigidbody rb = actor.GetComponent<Rigidbody>();
|
||||
if (rb != null)
|
||||
{
|
||||
rb.WakeUp();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c1f474cbd94238f4683f4d4f542d496b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,37 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// Event to wake up the rigidbody of a given actor.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Physics", "Wake Up", CutsceneItemGenre.ActorItem)]
|
||||
public class RigidbodyWakeUpEvent : CinemaActorEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Trigger this event and wake up the rigidbody component of the given actor.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to wake up.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
Rigidbody rb = actor.GetComponent<Rigidbody>();
|
||||
if (rb != null)
|
||||
{
|
||||
rb.WakeUp();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and wake up the rigidbody component of the given actor.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor to wake up.</param>
|
||||
public override void Reverse(GameObject actor)
|
||||
{
|
||||
Rigidbody rb = actor.GetComponent<Rigidbody>();
|
||||
if (rb != null)
|
||||
{
|
||||
rb.Sleep();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a09dafba508d9ea469dd2b42c146ccf4
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,81 @@
|
|||
using CinemaDirector.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CinemaDirector
|
||||
{
|
||||
/// <summary>
|
||||
/// An event to set the mass of the rigidbody of a given actor.
|
||||
/// </summary>
|
||||
[CutsceneItemAttribute("Physics", "Set Mass", CutsceneItemGenre.ActorItem)]
|
||||
public class SetMassEvent : CinemaActorEvent, IRevertable
|
||||
{
|
||||
// The new mass.
|
||||
public float Mass = 1f;
|
||||
|
||||
// Options for reverting in editor.
|
||||
[SerializeField]
|
||||
private RevertMode editorRevertMode = RevertMode.Revert;
|
||||
|
||||
// Options for reverting during runtime.
|
||||
[SerializeField]
|
||||
private RevertMode runtimeRevertMode = RevertMode.Revert;
|
||||
|
||||
/// <summary>
|
||||
/// Cache the state of all actors related to this event.
|
||||
/// </summary>
|
||||
/// <returns>All the revert info related to this event.</returns>
|
||||
public RevertInfo[] CacheState()
|
||||
{
|
||||
List<Transform> actors = new List<Transform>(GetActors());
|
||||
List<RevertInfo> reverts = new List<RevertInfo>();
|
||||
foreach (Transform go in actors)
|
||||
{
|
||||
if (go != null)
|
||||
{
|
||||
Rigidbody rb = go.GetComponent<Rigidbody>();
|
||||
if (rb != null)
|
||||
{
|
||||
reverts.Add(new RevertInfo(this, rb, "mass", rb.mass));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return reverts.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger this event and set a new mass for the actor's rigidbody.
|
||||
/// </summary>
|
||||
/// <param name="actor">The actor whose mass will be set.</param>
|
||||
public override void Trigger(GameObject actor)
|
||||
{
|
||||
if (actor == null) return;
|
||||
|
||||
Rigidbody affectedObjectRigidBody = actor.GetComponent<Rigidbody>();
|
||||
|
||||
if (affectedObjectRigidBody != null)
|
||||
{
|
||||
affectedObjectRigidBody.mass = Mass;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Editor.
|
||||
/// </summary>
|
||||
public RevertMode EditorRevertMode
|
||||
{
|
||||
get { return editorRevertMode; }
|
||||
set { editorRevertMode = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Option for choosing when this Event will Revert to initial state in Runtime.
|
||||
/// </summary>
|
||||
public RevertMode RuntimeRevertMode
|
||||
{
|
||||
get { return runtimeRevertMode; }
|
||||
set { runtimeRevertMode = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2ec608ab9e51cfc4b839e9fcab9025b3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue