Beispiel #1
0
        private void findColliders(List <RigidBodyComponent> colliders, ObjectId id)
        {
            if (!ToggleCollisions)
            {
                return;
            }

            ObjectPrivate op = ScenePrivate.FindObject(id);

            if (op != null)
            {
                for (uint rbi = 0; rbi < op.GetComponentCount(ComponentType.RigidBodyComponent); ++rbi)
                {
                    if (op.TryGetComponent(rbi, out RigidBodyComponent rb))
                    {
                        if (rb != null)
                        {
                            if (colliders.Contains(rb))
                            {
                                return;
                            }
                            colliders.Add(rb);
                        }
                    }
                }
            }
        }
Beispiel #2
0
    public override void Init()
    {
        Log.Write("In CustomInstrumentController");
        ComplexInteraction.SetPrompt(".");
        Script.UnhandledException += UnhandledException; // Catch errors and keep running unless fatal
        ObjectPrivate.TryGetComponent <AudioComponent>(0, out audio);

        SubscribeToScriptEvent("SecurityList", getSecurity);
        InitializeComplexInteraction();
    }
Beispiel #3
0
    public override void Init()
    {
        if (!ObjectPrivate.TryGetFirstComponent(out light))
        {
            Log.Write(LogLevel.Error, "SimpleLight::Init", "Object must have a scriptable light added at edit time for SimpleLight script to work.");
            return;
        }

        if (ObjectPrivate.TryGetComponent(1, out light2))
        {
            SecondLight = true;
            //Log.Write("Second Light");
        }

        if (!light.IsScriptable)
        {
            Log.Write(LogLevel.Error, "SimpleLight::Init", "Light must be set to scriptable at edit time for SimpleLight script to work.");
            return;
        }
        if (LightMode1.Length > 0)
        {
            ParseLights(0, LightMode1);
        }
        if (LightMode2.Length > 0)
        {
            ParseLights(1, LightMode2);
        }
        if (LightMode3.Length > 0)
        {
            ParseLights(2, LightMode3);
        }
        if (LightMode4.Length > 0)
        {
            ParseLights(3, LightMode4);
        }
        if (LightMode5.Length > 0)
        {
            ParseLights(4, LightMode5);
        }
        if (LightMode6.Length > 0)
        {
            ParseLights(5, LightMode6);
        }
        if (LightMode7.Length > 0)
        {
            ParseLights(6, LightMode7);
        }
        if (LightMode8.Length > 0)
        {
            ParseLights(7, LightMode8);
        }
        if (LightMode9.Length > 0)
        {
            ParseLights(8, LightMode9);
        }
        if (LightMode10.Length > 0)
        {
            ParseLights(9, LightMode10);
        }
        if (LightMode11.Length > 0)
        {
            ParseLights(10, LightMode11);
        }
        if (LightMode12.Length > 0)
        {
            ParseLights(11, LightMode12);
        }
        if (LightMode13.Length > 0)
        {
            ParseLights(12, LightMode13);
        }
        if (LightMode14.Length > 0)
        {
            ParseLights(13, LightMode14);
        }
        if (LightMode15.Length > 0)
        {
            ParseLights(14, LightMode15);
        }
        if (LightMode16.Length > 0)
        {
            ParseLights(15, LightMode16);
        }
        if (LightMode17.Length > 0)
        {
            ParseLights(16, LightMode17);
        }
        if (LightMode18.Length > 0)
        {
            ParseLights(17, LightMode18);
        }
    }