You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
4.1 KiB
96 lines
4.1 KiB
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentContextApiGenerator.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
public partial class CombatContext {
|
|
|
|
public CombatEntity cameraShakeEntity { get { return GetGroup(CombatMatcher.CameraShake).GetSingleEntity(); } }
|
|
public CoreGame.Render.CameraShakeComponent cameraShake { get { return cameraShakeEntity.cameraShake; } }
|
|
public bool hasCameraShake { get { return cameraShakeEntity != null; } }
|
|
|
|
public CombatEntity SetCameraShake(float newDuration, string newPath) {
|
|
if (hasCameraShake) {
|
|
throw new Entitas.EntitasException("Could not set CameraShake!\n" + this + " already has an entity with CoreGame.Render.CameraShakeComponent!",
|
|
"You should check if the context already has a cameraShakeEntity before setting it or use context.ReplaceCameraShake().");
|
|
}
|
|
var entity = CreateEntity();
|
|
entity.AddCameraShake(newDuration, newPath);
|
|
return entity;
|
|
}
|
|
|
|
public void ReplaceCameraShake(float newDuration, string newPath) {
|
|
var entity = cameraShakeEntity;
|
|
if (entity == null) {
|
|
entity = SetCameraShake(newDuration, newPath);
|
|
} else {
|
|
entity.ReplaceCameraShake(newDuration, newPath);
|
|
}
|
|
}
|
|
|
|
public void RemoveCameraShake() {
|
|
cameraShakeEntity.Destroy();
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityApiGenerator.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
public partial class CombatEntity {
|
|
|
|
public CoreGame.Render.CameraShakeComponent cameraShake { get { return (CoreGame.Render.CameraShakeComponent)GetComponent(CombatComponentsLookup.CameraShake); } }
|
|
public bool hasCameraShake { get { return HasComponent(CombatComponentsLookup.CameraShake); } }
|
|
|
|
public void AddCameraShake(float newDuration, string newPath) {
|
|
var index = CombatComponentsLookup.CameraShake;
|
|
var component = (CoreGame.Render.CameraShakeComponent)CreateComponent(index, typeof(CoreGame.Render.CameraShakeComponent));
|
|
component.duration = newDuration;
|
|
component.path = newPath;
|
|
AddComponent(index, component);
|
|
}
|
|
|
|
public void ReplaceCameraShake(float newDuration, string newPath) {
|
|
var index = CombatComponentsLookup.CameraShake;
|
|
var component = (CoreGame.Render.CameraShakeComponent)CreateComponent(index, typeof(CoreGame.Render.CameraShakeComponent));
|
|
component.duration = newDuration;
|
|
component.path = newPath;
|
|
ReplaceComponent(index, component);
|
|
}
|
|
|
|
public void RemoveCameraShake() {
|
|
RemoveComponent(CombatComponentsLookup.CameraShake);
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherApiGenerator.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
public sealed partial class CombatMatcher {
|
|
|
|
static Entitas.IMatcher<CombatEntity> _matcherCameraShake;
|
|
|
|
public static Entitas.IMatcher<CombatEntity> CameraShake {
|
|
get {
|
|
if (_matcherCameraShake == null) {
|
|
var matcher = (Entitas.Matcher<CombatEntity>)Entitas.Matcher<CombatEntity>.AllOf(CombatComponentsLookup.CameraShake);
|
|
matcher.componentNames = CombatComponentsLookup.componentNames;
|
|
_matcherCameraShake = matcher;
|
|
}
|
|
|
|
return _matcherCameraShake;
|
|
}
|
|
}
|
|
}
|
|
|