示例#1
0
    public void Initialize()
    {
        SessionID = IDFactory.GenerateEntityID();

        stats = new StatCollection();
        stats.Initialize(statTemplate);

        SpriteRenderer     = GetComponentInChildren <SpriteRenderer>();
        MyAnimator         = GetComponentInChildren <Animator>();
        AbilityManager     = GetComponent <AbilityManager>();
        inventory          = GetComponent <Inventory>();
        movement           = GetComponent <EntityMovement>();
        healthDeathManager = GetComponent <HealthDeathManager>();

        if (inventory != null)
        {
            inventory.Initialize(this);
        }

        if (AbilityManager != null)
        {
            AbilityManager.Initialize(this);
        }

        if (movement != null)
        {
            movement.Initialize();
        }

        if (healthDeathManager != null)
        {
            healthDeathManager.Initialize(this);
        }


        AIBrain testBrain = GetComponent <AIBrain>();

        if (testBrain != null)
        {
            testBrain.Initialize();
        }


        GameManager.RegisterEntity(this);
    }
示例#2
0
 protected virtual void Awake()
 {
     SessionID = IDFactory.GenerateEntityID();
     GameManager.RegisterEntity(this);
 }
示例#3
0
 private void Register()
 {
     EntityID = IDFactory.GenerateEntityID();
     EntityManager.RegisterEntity(this);
 }