Exemple #1
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;
        }
Exemple #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;
        }