コード例 #1
0
        private void OnGridAdd(EntityUid uid, MapGridComponent component, ComponentAdd args)
        {
            // GridID is not set yet so we don't include it.
            var msg = new GridAddEvent(uid);

            EntityManager.EventBus.RaiseLocalEvent(uid, msg);
        }
コード例 #2
0
 private void OnShuttleAdd(EntityUid uid, ShuttleComponent component, ComponentAdd args)
 {
     // Easier than doing it in the comp and they don't have constructors.
     for (var i = 0; i < component.LinearThrusters.Length; i++)
     {
         component.LinearThrusters[i] = new List <ThrusterComponent>();
     }
 }
コード例 #3
0
    private void SetupKudzu(EntityUid uid, GrowingKudzuComponent component, ComponentAdd args)
    {
        if (!EntityManager.TryGetComponent <AppearanceComponent>(uid, out var appearance))
        {
            return;
        }

        appearance.SetData(KudzuVisuals.Variant, _robustRandom.Next(1, 3));
        appearance.SetData(KudzuVisuals.GrowthLevel, 1);
    }
コード例 #4
0
        private void OnLookupAdd(EntityUid uid, EntityLookupComponent component, ComponentAdd args)
        {
            int capacity;

            if (EntityManager.TryGetComponent(uid, out TransformComponent? xform))
            {
                capacity = (int)Math.Min(256, Math.Ceiling(xform.ChildCount / (float)GrowthRate) * GrowthRate);
            }
            else
            {
                capacity = 256;
            }

            component.Tree = new DynamicTree <EntityUid>(
                GetTreeAABB,
                capacity: capacity,
                growthFunc: x => x == GrowthRate ? GrowthRate * 8 : x * 2
                );
        }
コード例 #5
0
 private void OnComponentAdd(EntityUid uid, CharacterInfoComponent component, ComponentAdd args)
 {
     component.Scene = component.Control = new CharacterInfoComponent.CharacterInfoControl();
 }
コード例 #6
0
ファイル: Inspector.cs プロジェクト: sjb8100/ingame-editor-ui
 public Inspector(Rect inspectorRect)
 {
     this.inspectorRect = inspectorRect;
     this.componentAdd  = new ComponentAdd(this);
 }