Exemple #1
0
        public void ExecuteOnTarget(HeroKitObject targetObject, string scriptName, bool enableComponent, bool setProperties)
        {
            //------------------------------------
            // attach the script to the target object as a component
            //------------------------------------

            MonoBehaviour component = HeroKitCommonRuntime.AddComponentFromScript(heroKitObject, targetObject, scriptName);

            //------------------------------------
            // enable or disable the script component
            //------------------------------------

            component.enabled = enableComponent;

            //------------------------------------
            // set the properties for the script
            //------------------------------------

            if (setProperties)
            {
                PropertyValue.SetValueA(targetObject, 5, component);
            }
        }