public void UpdatePositionsOnly() { if(UpdatePositionsOnlyMethod != null){ SurfaceDefaults d = new SurfaceDefaults(defaults); UpdatePositionsOnlyMethod(d); d.FillValues(true,false); window.UpdatePositionVertexArray(this,d.positions,d.layouts); } }
public SurfaceDefaults(SurfaceDefaults other) { if(other.positions != null){ positions = new List<int>(other.positions); } if(other.layouts != null){ layouts = new List<int>(other.layouts); } if(other.sprites != null){ sprites = new List<int>(other.sprites); } if(other.sprite_types != null){ sprite_types = new List<int>(other.sprite_types); } if(other.other_data != null){ other_data = new List<float>[other.other_data.GetLength(0)]; int idx = 0; foreach(List<float> l in other.other_data){ other_data[idx] = new List<float>(l); ++idx; } } single_position = other.single_position; single_layout = other.single_layout; single_sprite = other.single_sprite; single_sprite_type = other.single_sprite_type; single_other_data = other.single_other_data; fill_count = other.fill_count; }
public void UpdateOtherDataOnly() { if(UpdateOtherDataOnlyMethod != null){ SurfaceDefaults d = new SurfaceDefaults(defaults); UpdateOtherDataOnlyMethod(d); d.FillValues(false,true); window.UpdateOtherVertexArray(this,-1,d.sprites,d.sprite_types,d.other_data); } }
public void Update() { if(UpdateMethod != null){ SurfaceDefaults d = new SurfaceDefaults(defaults); UpdateMethod(d); d.FillValues(true,true); window.UpdatePositionVertexArray(this,d.positions,d.layouts); window.UpdateOtherVertexArray(this,-1,d.sprites,d.sprite_types,d.other_data); } }
/*public void SetDefaults(IList<int> positions,IList<int> layouts,IList<int> sprites,IList<int> sprite_types,params IList<float>[] other_data){ defaults = new SurfaceDefaults(); if(positions != null){ defaults.positions = new List<int>(positions); } if(layouts != null){ defaults.layouts = new List<int>(layouts); } if(sprites != null){ defaults.sprites = new List<int>(sprites); } if(sprite_types != null){ defaults.sprite_types = new List<int>(sprite_types); } if(other_data != null){ defaults.other_data = new List<float>[other_data.GetLength(0)]; int idx = 0; foreach(List<float> l in other_data){ other_data[idx] = new List<float>(l); ++idx; } } }*/ public void SetDefaults(SurfaceDefaults new_defaults) { defaults = new_defaults; }
public void DefaultUpdatePositions() { SurfaceDefaults d = new SurfaceDefaults(defaults); d.FillValues(true,false); window.UpdatePositionVertexArray(this,d.positions,d.layouts); }
public void DefaultUpdateOtherData() { SurfaceDefaults d = new SurfaceDefaults(defaults); d.FillValues(false,true); window.UpdateOtherVertexArray(this,-1,d.sprites,d.sprite_types,d.other_data); }