//----------------------------------- Methods ----------------------------------- // Use this for initialization void Start() { // New attribute list (widget) m_allLinkedAttributes = gameObject.AddComponent <Widget>(); // Add all used attributes m_allLinkedAttributes.AddAttribute <int> ("ActiveTool", 0); // 0 Rect Brush, 1 Gradient Brush, 2 Circle Brush, 3 Image Brush m_allLinkedAttributes.AddAttribute <Gradient> ("FalloffGradient", new Gradient()); // Gradient Brush falloff m_allLinkedAttributes.AddAttribute <Gradient> ("FalloffCircle", new Gradient()); // Circle falloff m_allLinkedAttributes.AddAttribute <Gradient> ("FalloffSmoothing", new Gradient()); // Smoothing falloff m_allLinkedAttributes.AddAttribute <int> ("Radius", 15); // Radius of the circle brush m_allLinkedAttributes.AddAttribute <float> ("BrushWeight", 1.0f); m_allLinkedAttributes.AddAttribute <Vector2> ("BrushArrayDimensions", new Vector2(1, 1)); m_allLinkedAttributes.AddAttribute <Vector2> ("BrushAnchor", new Vector2(0, 0)); // init the gradient attributes m_allLinkedAttributes.GetAttribute <Gradient> ("FalloffGradient").SetKeys(new GradientColorKey[] { new GradientColorKey(Color.white, 0) }, new GradientAlphaKey[] { new GradientAlphaKey(1, 0), new GradientAlphaKey(0, 1) }); m_allLinkedAttributes.GetAttribute <Gradient> ("FalloffCircle").SetKeys(new GradientColorKey[] { new GradientColorKey(Color.white, 0) }, new GradientAlphaKey[] { new GradientAlphaKey(1, 0), new GradientAlphaKey(0, 1) }); m_allLinkedAttributes.GetAttribute <Gradient> ("FalloffSmoothing").SetKeys(new GradientColorKey[] { new GradientColorKey(Color.white, 0) }, new GradientAlphaKey[] { new GradientAlphaKey(1, 0), new GradientAlphaKey(0, 1) }); m_allLinkedAttributes.AddAttribute <float> ("NoiseScale", 1.0f); m_allLinkedAttributes.AddAttribute <Vector2> ("NoiseOffset", Vector2.zero); // Cache the map handler script m_mapHandlerScript = GameObject.FindGameObjectWithTag("MapHandler").GetComponent <MapHandler> (); m_activeArea = new Rect(0, 0, Screen.width, Screen.height); SetBrushArraySquare(); }
//----------------------------------- Methods ----------------------------------- // Use this for initialization void Start() { // New attribute list (widget) m_allLinkedAttributes = gameObject.AddComponent <Widget>(); // Add all used attributes m_allLinkedAttributes.AddAttribute <int> ("ChunkDimensions", 10); m_allLinkedAttributes.AddAttribute <int> ("ChunksToLoadDimensions", 10); //m_allLinkedAttributes.AddAttribute <Vector2> ("NoiseOffset", Vector2.zero); SpawnNewTerrain(); }
// Use this for initialization void Start() { // New attribute list (widget) m_allLinkedAttributes = gameObject.AddComponent <Widget>(); // Add all used attributes m_allLinkedAttributes.AddAttribute <int> ("CaveDivRes", 10); // 0 Rect Brush, 1 Gradient Brush, 2 Circle Brush, 3 Image Brush m_allLinkedAttributes.AddAttribute <int> ("CaveRoundRes", 12); // Gradient Brush falloff m_caveObjects = new List <GameObject> (); m_mapHandler = GameObject.FindGameObjectWithTag("MapHandler").GetComponent <MapHandler> (); }
// Use this for initialization void Start() { // New attribute list (widget) m_allLinkedAttributes = gameObject.AddComponent <Widget>(); // Add all used attributes, Add 1 value to the textures set by default m_allLinkedAttributes.AddAttribute <List <TextureSlot> > ("Textures", new List <TextureSlot>() { new TextureSlot(0, new Texture2D(64, 64)) }); m_allLinkedAttributes.AddAttribute <int> ("SelectedTexture", 0); ModSelectedLayerSettings(); }
// Use this for initialization void Start() { // New attribute list (widget) m_allLinkedAttributes = gameObject.AddComponent <Widget>(); // Add all used attributes, Add 1 value to the layers set by default m_allLinkedAttributes.AddAttribute <List <Layer> > ("Layers", new List <Layer>() { new Layer(LayerFunctionType.Normal, 0) }); m_allLinkedAttributes.AddAttribute <int> ("SelectedLayer", 0); m_allLinkedAttributes.AddAttribute <LayerFunctionType> ("LayerMode", m_allLinkedAttributes.GetAttribute <List <Layer> > ("Layers")[0].m_layerFunctionType); m_allLinkedAttributes.AddAttribute <float> ("LayerOpacity", 1); m_allLinkedAttributes.AddAttribute <Vector2> ("LayerOffset", Vector2.zero); ModSelectedLayerSettings(); }
public override void Initialize() { Widget = (Gtk.ComboBox)CreateWidget(); var cr = new Gtk.CellRendererText(); Widget.PackStart(cr, false); Widget.AddAttribute(cr, "text", 0); Widget.Show(); Widget.RowSeparatorFunc = IsRowSeparator; }
public override void Initialize() { //NeedsEventBox = false; // TODO: needs fix: no events with or without event box Widget = (Gtk.ComboBox)CreateWidget(); if (Widget.Cells.Length == 0) { var cr = new Gtk.CellRendererText(); Widget.PackStart(cr, false); Widget.AddAttribute(cr, "text", 0); } Widget.Show(); Widget.RowSeparatorFunc = IsRowSeparator; }
public void AddAttribute(object target, Gtk.CellRenderer cr, string field, int column) { Widget.AddAttribute(cr, field, column); }