예제 #1
0
    private void UpdateLevelObject()
    {
        if (IsOccuppied() && !gridObject.IsUnit())
        {
            Dictionary <ObjectType, Variant> dict = gridCreator.editorParams.objVariants;
            EditorLevelObject obj = (EditorLevelObject)gridObject;

            if (obj.Type != gridCreator.editorParams.obj)
            {
                if (dict.ContainsKey(obj.Type))
                {
                    obj.UpdateLevelObject(gridCreator.editorParams.obj);
                }
                obj.UpdateLevelObject(gridCreator.editorParams.obj);
            }
            else if (dict.ContainsKey(obj.Type) && obj.Variant != dict[obj.Type].variant)
            {
                obj.SetVariant(dict[obj.Type].variant);
            }
        }
        else
        {
            gridCreator.AddLevelHazard(this);
        }
    }