protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _sls = registry.GetSystem <SceneLoaderSystem>(); _as = registry.GetSystem <AssetSystem>(); }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _ballState = GameObject.GetComponent <BallState>(); _audioSource = new AudioSourceComponent(); GameObject.AddComponent(_audioSource); _audioSource.AudioClip = new AssetRef <WaveFile>("Audio/BoostNoise.wav"); _audioSource.Gain = 4.0f; var shs = registry.GetSystem <SynchronizationHelperSystem>(); Task.Run(() => { var particleChildPrefab = registry.GetSystem <AssetSystem>().Database.LoadAsset <SerializedPrefab>("Prefabs/LinearBoostParticles.prefab", false); var particleChild = particleChildPrefab.Instantiate(registry.GetSystem <GameObjectQuerySystem>()); var transformFollow = new TransformFollow() { Target = Transform }; particleChild.AddComponent(transformFollow); _childParticleSystem = particleChild.GetComponent <ParticleSystem>(); }); _currentAvailableBoosts = MaxBoosts; }
protected override void Start(SystemRegistry registry) { _physics = registry.GetSystem <PhysicsSystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _input = registry.GetSystem <InputSystem>(); _time = (float)Math.PI / 2f; }
protected override void Start(SystemRegistry registry) { _levelLoadTrigger = GameObject.GetComponent <LevelLoadTrigger>(); _levelLoadTrigger.LevelLoadTriggered += OnLevelLoadTriggered; _goqs = registry.GetSystem <GameObjectQuerySystem>(); _sls = registry.GetSystem <SceneLoaderSystem>(); }
protected override void PostAttached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); _ad = registry.GetSystem <AssetSystem>().Database; _texture = Texture.Get(_ad); _cameraDistanceComparer = new CameraDistanceComparer(_gs); _gs.ExecuteOnMainThread(() => InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache)); }
protected override void Attached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); _as = registry.GetSystem <AssetSystem>(); var ad = _as.Database; RecreateCubemapTexture(); _gs.ExecuteOnMainThread(() => InitializeContextObjects(ad, _gs.Context)); }
protected unsafe override void Start(SystemRegistry registry) { _assetSystem = registry.GetSystem <AssetSystem>(); _sls = registry.GetSystem <SceneLoaderSystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _audioSource = GameObject.GetComponent <AudioSourceComponent>(); LoadFont(); _gs.ImGuiRenderer.RecreateFontDeviceTexture(_gs.Context); _allScenes = _assetSystem.Database.GetAssetsOfType(typeof(SceneAsset)); }
protected override void Attached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); _ad = registry.GetSystem <AssetSystem>().Database; _texture = Texture.Get(_ad); _mesh = Mesh.Get(_ad); _centeredBoundingSphere = _mesh.GetBoundingSphere(); _centeredBoundingBox = _mesh.GetBoundingBox(); _gs.ExecuteOnMainThread(() => { InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache); }); }
protected override void Attached(SystemRegistry registry) { _assetSystem = registry.GetSystem <AssetSystem>(); _audioSystem = registry.GetSystem <AudioSystem>(); _source = _audioSystem.Engine.ResourceFactory.CreateAudioSource(); OnTransformChanged(Transform); _source.Gain = _gain; _source.Looping = Looping; if (_clipRef != null && !_clipRef.ID.IsEmpty) { GetBufferForRef(); } }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _goqs = registry.GetSystem <GameObjectQuerySystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _physics = registry.GetSystem <PhysicsSystem>(); _ball = _goqs.FindByName(BallName); if (_ball == null) { throw new InvalidOperationException("No Ball found in scene with name " + BallName); } _ballCollider = _ball.GetComponent <Collider>(); _ballState = _ball.GetComponent <BallState>(); }
protected override void Start(SystemRegistry registry) { GameObject.RemoveComponent(this); _ccs = registry.GetSystem <ConsoleCommandSystem>(); if (_ccs != null) { _ccs.Print += AddLine; _gs = registry.GetSystem <GraphicsSystem>(); _input = registry.GetSystem <InputSystem>(); } else { Enabled = false; } }
protected override void Attached(SystemRegistry registry) { _as = registry.GetSystem <AssetSystem>(); _meshData = _as.Database.LoadAsset <MeshData>(_meshAsset.ID); _textureData = _as.Database.LoadAsset <ImageSharpTexture>(_textureAsset.ID); _transform = GameObject.Transform; _centeredBounds = _meshData.GetBoundingBox(); _objectCenter = _centeredBounds.GetCenter(); // _gs.ExecuteOnMainThread(() => // { // InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache); // }); // _gs = registry.GetSystem<GraphicsSystem>(); // _ad = registry.GetSystem<AssetSystem>().Database; // _texstture = Texture.Get(_ad); // _mesh = Mesh.Get(_ad); // _centeredBoundingSphere = _mesh.GetBoundingSphere(); // _centeredBoundingBox = _mesh.GetBoundingBox(); // _gs.ExecuteOnMainThread(() => // { // InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache); // }); }
protected override void PostAttached(SystemRegistry registry) { _as = registry.GetSystem <AssetSystem>(); if (_mesh.GetRef() != null) { SetEntity(CreateEntity()); } }
public override void Execute(string args, SystemRegistry registry) { var topLevelGOs = registry.GetSystem <GameObjectQuerySystem>().GetUnparentedGameObjects(); foreach (var go in topLevelGOs) { PrintGo(go, 0); } }
protected override void Attached(SystemRegistry registry) { _physics = registry.GetSystem <PhysicsSystem>(); Controller = new BEPUphysics.Character.CharacterController( Transform.Position, jumpSpeed: 8f, tractionForce: 1500 ); }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _ballCollider = GameObject.GetComponent <SphereCollider>(); int magnetTrackerLayer = registry.GetSystem <PhysicsSystem>().GetLayerByName("MagnetDetector"); _magnetTrackingZone = ObjectTrackingZone.Create(GameObject.Transform, Radius, "CrazyCore.Magnet", magnetTrackerLayer); _zoneSphereCollider = _magnetTrackingZone.GameObject.GetComponent <SphereCollider>(); AssetSystem assetSystem = registry.GetSystem <AssetSystem>(); _magnetParticleGo = assetSystem.Database.LoadAsset <SerializedPrefab>("Prefabs/MagnetParticles.prefab", false) .Instantiate(registry.GetSystem <GameObjectQuerySystem>()); _magnetParticles = _magnetParticleGo.GetComponent <ParticleSystem>(); _magnetParticleGo.Transform.Parent = Transform; _magnetParticleGo.Transform.LocalPosition = Vector3.Zero; }
public override void Execute(string args, SystemRegistry registry) { var options = registry.GetSystem <ConsoleCommandSystem>()._commandOptions; Print("Availiable commands:"); foreach (var option in options) { string name = option.Names.Last(); var aliases = option.Names.Take(option.Names.Length - 1); Print($" {name}, ({string.Join(", ", aliases)})"); } }
protected override void Start(SystemRegistry registry) { _particleSystem = GameObject.GetComponent <ParticleSystem>(); Collider collider = GameObject.GetComponent <Collider>(); if (collider == null) { throw new InvalidOperationException("No collider on magnet " + GameObject.Name); } collider.Layer = registry.GetSystem <PhysicsSystem>().GetLayerByName("Magnet"); }
public static Skybox LoadDefaultSkybox(SystemRegistry registry) { var assetSystem = registry.GetSystem <AssetSystem>(); AssetDatabase ad = assetSystem.Database; AssetRef <ImageSharpTexture> front = new AssetRef <ImageSharpTexture>(EngineEmbeddedAssets.SkyboxFrontID); AssetRef <ImageSharpTexture> back = new AssetRef <ImageSharpTexture>(EngineEmbeddedAssets.SkyboxBackID); AssetRef <ImageSharpTexture> left = new AssetRef <ImageSharpTexture>(EngineEmbeddedAssets.SkyboxLeftID); AssetRef <ImageSharpTexture> right = new AssetRef <ImageSharpTexture>(EngineEmbeddedAssets.SkyboxRightID); AssetRef <ImageSharpTexture> top = new AssetRef <ImageSharpTexture>(EngineEmbeddedAssets.SkyboxTopID); AssetRef <ImageSharpTexture> bottom = new AssetRef <ImageSharpTexture>(EngineEmbeddedAssets.SkyboxBottomID); var skybox = new Skybox(front, back, left, right, top, bottom); skybox._as = assetSystem; return(skybox); }
protected override void Start(SystemRegistry registry) { _physics = registry.GetSystem <PhysicsSystem>(); _collider = GameObject.GetComponent <Collider>(); _entityMover = new EntityMover(_collider.Entity); _spline = new CardinalSpline3D(); _spline.PreLoop = MapBoundaryBehavior(_boundaryBehavior); _spline.PostLoop = MapBoundaryBehavior(_boundaryBehavior); Vector3 origin = Transform.Position; foreach (var offset in TargetOffsets.OrderBy(co => co.Time)) { _spline.ControlPoints.Add(offset.Time, origin + offset.Offset); } _physics.AddObject(_entityMover); _elapsedPreActivationTime = PreActivateTime; }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _audioSource = GameObject.GetComponent <AudioSourceComponent>(); }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _shs = registry.GetSystem <SynchronizationHelperSystem>(); }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); }
protected sealed override void Attached(SystemRegistry registry) { _bus = registry.GetSystem <BehaviorUpdateSystem>(); PostAttached(registry); }
protected override void Start(SystemRegistry registry) { _audioSystem = registry.GetSystem <AudioSystem>(); _lastSoundTime = DateTime.UtcNow; }
protected sealed override void Attached(SystemRegistry registry) { _es = registry.GetSystem <EditorSystem>(); Start(registry); }
protected override void Start(SystemRegistry registry) { base.Start(registry); _gs = registry.GetSystem <GraphicsSystem>(); _input = registry.GetSystem <InputSystem>(); }
protected override void Attached(SystemRegistry registry) { _collider = GameObject.GetComponent <Collider>(); _goqs = registry.GetSystem <GameObjectQuerySystem>(); }
protected override void Attached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); }
internal override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); }