Exemple #1
0
        ///<summary>
        ///initialize using associated entity
        ///</summary>
        ///<param name="entity">associated entity</param>
        public void Initialize(Entity entity)
        {
            _door = entity as Door;

            //Material =
            //   TorqueObjectDatabase.Instance.FindObject("corrodedMetalMaterial")
            //   as SimpleMaterial;

            SimpleMaterial simpleMaterial = new SimpleMaterial();
            simpleMaterial.TextureFilename =
                @"data\images\Mindcrafters\corrodedMetal";
            simpleMaterial.IsTranslucent = true;
            simpleMaterial.IsColorBlended = true;

            Material = simpleMaterial;

            Layer = 30;
            IsTemplate = false;
            Size = new Vector2(16, 16);
        }
Exemple #2
0
        ///<summary>
        ///Add a door using given door data
        ///</summary>
        ///<param name="doorData"></param>
        public void AddDoor(DoorData doorData)
        {
            Door door = new Door(this, doorData);
            Doors.Add(door);

            //register the entity
            EntityManager.Instance.RegisterEntity(door);
        }