internal LayerState(StateModeEnum mode, LayersImpl layers, LayerStates baseStates) { this.mode = mode; this.layers = layers; this.layers.parentState = this; Attach(baseStates); }
void Awake() { layerStates = GetComponent<LayerStates> (); camera = GameObject.Find ("Main Camera").camera; /* * First we need to determine how large the array of children * with Renderers is going to be so that we can update the * childRenderers arrays size */ int rendererCount = 0; foreach (Transform transformChild in transform) { if(transformChild.gameObject.GetComponent<Renderer>()) { rendererCount++; } } childRenderers = new Renderer[rendererCount]; // Set the new array size int rendererIterator = 0; // Set up an iterator count so we can add renderers into array and set up material Colors foreach (Transform transformChild in transform) { // Iterate through all the child transforms of this Shape Layer if(transformChild.gameObject.GetComponent<Renderer>()) { // Check to see if this child has a renderer component Renderer thisRenderer = transformChild.gameObject.GetComponent<Renderer>(); // Cache this iteration's Renderer childRenderers[rendererIterator] = thisRenderer; // Add it into the array Color col = thisRenderer.material.color; // Cache the Color var newMat = new Color(col.r, col.g, col.b, 1); // Create a new Color reference thisRenderer.material.color = newMat; // Set the renderer material's colour to the newMat variable reference rendererIterator++; // Increment the iteration counter } } }
/** * <summary>Creates a new action within the given document context.</summary> */ public SetLayerState( Document context, params LayerState[] states ) : base(context, PdfName.SetOCGState) { States = new LayerStates(); if (states != null && states.Length > 0) { var layerStates = States; foreach (var state in states) { layerStates.Add(state); } } }
protected override void RemoveItem(int index) { // High-level definition. base.RemoveItem(index); // Low-level definition. LayerStates baseStates = BaseStates; if (baseStates != null) { int baseIndex = baseStates.GetBaseIndex(parentState); int itemIndex = baseIndex + 1 // Name object offset. + index; // Layer object offset. baseStates.BaseDataObject.RemoveAt(itemIndex); } }
protected override void InsertItem(int index, Layer item) { // High-level definition. base.InsertItem(index, item); // Low-level definition. LayerStates baseStates = BaseStates; if (baseStates != null) { int baseIndex = baseStates.GetBaseIndex(parentState); int itemIndex = baseIndex + 1 // Name object offset. + index; // Layer object offset. baseStates.BaseDataObject[itemIndex] = item.BaseObject; } }
protected override void ClearItems() { // Low-level definition. LayerStates baseStates = BaseStates; if (baseStates != null) { int itemIndex = baseStates.GetBaseIndex(parentState) + 1; // Name object offset. for (int count = Count; count > 0; count--) { baseStates.BaseDataObject.RemoveAt(itemIndex); } } // High-level definition. base.ClearItems(); }
/** * <summary>Creates a new action within the given document context.</summary> */ public SetLayerState( Document context ) : base(context, PdfName.SetOCGState) { States = new LayerStates(); }
internal void Detach( ) { baseStates = null; }
internal void Attach( LayerStates baseStates ) { this.baseStates = baseStates; }
public Layer() { chainStack = new StackManager(); state = LayerStates.Unchained; }
void Awake() { layerStates = gameObject.transform.parent.GetComponent<LayerStates> (); }