Ejemplo n.º 1
0
        private void Start()
        {
            health = GetComponent <Health>();
            health.SetHealth(1);
            health.OnDeath += (x, y) => Kill();

            Hurtbox.Create(gameObject, health);
        }
Ejemplo n.º 2
0
        protected void InitializeActor(bool initializeColliders = true)
        {
            movementController = gameObject.AddComponent <MovementController>();
            ViewController     = gameObject.AddComponent <ViewController>();
            health             = gameObject.AddComponent <Health>();
            platformController = gameObject.AddComponent <PlatformController>();

            if (initializeColliders)
            {
                foreach (var collider in gameObject.GetComponentsInChildren <Collider>())
                {
                    Hurtbox.Create(collider.gameObject, health);
                }
            }
        }