示例#1
0
        public override void Init()
        {
            base.Init();

            var ambientObjectType = GetObjectType();

            if (ambientObjectType.CustomControllerScript != null)
            {
                CustomController = (GameObjectController)SerializationUtils.CreateInstance(ambientObjectType.CustomControllerScript);
            }

            if (ambientObjectType.CustomRendererScript != null)
            {
                CustomRenderer = (GameObjectRenderer)SerializationUtils.CreateInstance(ambientObjectType.CustomRendererScript);
            }

            CustomController?.Init(this);
            CustomRenderer?.Init(this);
        }
示例#2
0
        public override void Init()
        {
            relativeBlockingBounds = MetaData.AmbientHitableObjectType.lookup[((AmbientHitableObject)this).AmbientHitableObjectType].RelativeBlockingRectangle;
            relativeHitBoxBounds   = MetaData.AmbientHitableObjectType.lookup[((AmbientHitableObject)this).AmbientHitableObjectType].RelativeHitboxRectangle;

            base.Init();

            var ambientHitableObjectType = GetObjectType();

            if (ambientHitableObjectType.CustomControllerScript != null)
            {
                CustomController = (GameObjectController)SerializationUtils.CreateInstance(ambientHitableObjectType.CustomControllerScript);
            }

            if (ambientHitableObjectType.CustomRendererScript != null)
            {
                CustomRenderer = (GameObjectRenderer)SerializationUtils.CreateInstance(ambientHitableObjectType.CustomRendererScript);
            }

            CustomController?.Init(this);
            CustomRenderer?.Init(this);
        }
示例#3
0
        public override void Init()
        {
            relativeBlockingBounds = MetaData.LivingEntityType.lookup[((LivingEntity)this).LivingEntityType].RelativeBlockingBounds;
            relativeHitBoxBounds   = MetaData.LivingEntityType.lookup[((LivingEntity)this).LivingEntityType].RelativeHitBoxBounds;

            base.Init();

            // Init skills
            var livingEntityType = GetObjectType();

            Skills = new Skill[livingEntityType.Skills == null ? 0 : livingEntityType.Skills.Length];

            if (livingEntityType.Skills != null)
            {
                for (int i = 0; i < livingEntityType.Skills.Length; i++)
                {
                    Skills[i] = SkillType.Create(this, livingEntityType.Skills[i]);
                }
            }

            // Init
            if (livingEntityType.CustomControllerScript != null)
            {
                CustomController = (GameObjectController)SerializationUtils.CreateInstance(livingEntityType.CustomControllerScript);
            }

            if (livingEntityType.CustomRendererScript != null)
            {
                CustomRenderer = (GameObjectRenderer)SerializationUtils.CreateInstance(livingEntityType.CustomRendererScript);
            }

            CustomController?.Init(this);
            CustomRenderer?.Init(this);

            SimulationGame.World.LivingEntities[ID] = this;
        }