Ejemplo n.º 1
0
        protected void Internal_AddComponent(Actor actor, ObjectScript compScript)
        {
            //Does the component already exist on the actor?  If it does, just apply this script.
            string CompName = compScript.FindObjectName();

            if (CompName != null && actor.HasComponent(CompName))
            {
                compScript.ApplyToObject(actor.GetComponentByName(CompName));
                return;
            }

            //Otherwise we create the Component
            ActorComponent AC = compScript.CreateInstance <ActorComponent>();

            AC.Owner = actor;
            AC.Register();
        }