Ejemplo n.º 1
0
        public void Init()
        {
            _myEnity = new Enity();
            _myEnity.AddProperty("name", "hero");
            _myEnity.Go = LoadModel();
            _animator   = _myEnity.Go.GetComponentInChildren <Animator>();
            _myEnity.AddComponent("display", new DisplayComponent());
            _myEnity.AddComponent("actionComponent", new ActionComponent());
            _myEnity.AddComponent("transformComponent", new TransformComponent());
            _myEnity.AddComponent("titleComponent", new TitleComponent());
            //_myEnity.AddComponent("mouseInteractiveComponent", new MouseInteractiveComponent());
            _myEnity.AddComponent("lifeBarComponent", new LifeBarComponent());

            /*PatrolComponent patrolComponent = new PatrolComponent();
             * _myEnity.AddComponent("patrolComponent", patrolComponent);*/
            EnityData _enityData = new EnityData();

            _myEnity.AddProperty("enityData", _enityData);
            _myEnity.Transform.gameObject.AddComponent <EnityBind>().Owner = _myEnity;

            //GameInput.Instance.OnUpdate += patrolComponent.Update;

            //test
            LifeBarComponent life = _myEnity.AddComponent <LifeBarComponent>();

            life.key = "test add";
            GetCamera();
        }
Ejemplo n.º 2
0
        private void Init()
        {
            _myEnity = new Enity();
            _myEnity.SetProperty("name", "enemy");
            _myEnity.Go = LoadModel();
            _myEnity.AddComponent("display", new DisplayComponent());
            _myEnity.AddComponent("actionComponent", new ActionComponent());
            _myEnity.AddComponent("transformComponent", new TransformComponent());
            _myEnity.AddComponent("lifeBarComponent", new LifeBarComponent());

            PatrolComponent patrolComponent = new PatrolComponent();

            _myEnity.AddComponent("patrolComponent", patrolComponent);

            EnityData _enityData = new EnityData();

            _myEnity.AddProperty("enityData", _enityData);
            _myEnity.Transform.gameObject.AddComponent <EnityBind>().Owner = _myEnity;

            GameInput.Instance.OnUpdate += patrolComponent.Update;
        }