示例#1
0
        public static object GetComponent(object This, ScriptObjectLink objLink, object[] parameters)
        {
            if (TypeContract.Ensure(parameters, new[] { typeof(string) }))
            {
                var wrapper = (EntityWrapper)This;
                var entity  = wrapper.GetEntity();

                var component = new EntityComponentWrapper
                {
                    parent = wrapper,
                    id     = parameters[0] as string
                };

                return(component);
            }

            return(NetUndefined.Instance);
        }
示例#2
0
        public static object GetComponent(object This, ScriptObjectLink objLink, object[] parameters)
        {
            if (TypeContract.Ensure(parameters, new[] { typeof(string) }))
            {
                var wrapper = (EntityWrapper)This;
                var entity = wrapper.GetEntity();

                var component = new EntityComponentWrapper
                {
                    parent = wrapper,
                    id = parameters[0] as string
                };

                return component;
            }

            return NetUndefined.Instance;
        }