public void ClearPreset() { if(presetToShow == null) return; presetToShow = null; ResetPos(); }
public void SwapToPreset(string id) { if(allPresets.Count(a => a.presetID == id) == 0) Debug.LogError("Animation preset does not exist: " + id); else { TouchAnimationPreset swapTo = allPresets.First(a => a.presetID == id); _activePreset = swapTo; } }
public void Load(TouchBase tb) { _activeBase = tb; TouchAnimation ta = tb.GetComponent<TouchAnimation>(); if(ta != null) SetPreset(ta.allPresets.First(a => a.presetID == ta.initialPreset)); else { presetToShow = null; ResetPos(); } }
public void SetPreset(TouchAnimationPreset p) { TouchGUIBase b = (_activeBase as TouchGUIBase); if(b == null) return; presetToShow = p; animSnapshotBase.color = presetToShow.unlatchedAnimationBase.transitionColor; animSnapshotTop.color = presetToShow.unlatchedAnimationTop.transitionColor; animSnapshotBase.size = presetToShow.unlatchedAnimationBase.changeToSize; animSnapshotTop.size = presetToShow.unlatchedAnimationTop.changeToSize; animSnapshotBase.texture = presetToShow.unlatchedAnimationBase.changeToTexture; animSnapshotTop.texture = presetToShow.unlatchedAnimationTop.changeToTexture; ResetPos(); }
public void Select(TouchBase toSelect) { GUI.FocusControl(""); selectedMiscPanel = null; _touchAnimationActivePreset = null; _touchBase = toSelect; baseImg = null; topImg = null; name = ""; if(toSelect != null ) { name = _touchBase.gameObject.name; if(toSelect is TouchGUIBase) { baseImg = ((TouchGUIBase)toSelect).basePart.texture; topImg = ((TouchGUIBase)toSelect).topPart.texture; } } }
private TouchAnimationPreset Aimation_GenerateDefaultAnimPreset(string presetName, TouchGUIBase t) { TouchAnimationPreset newAnimPreset = new TouchAnimationPreset{ presetID = presetName }; newAnimPreset.latchedAnimationTop = new TouchAnimationInformation(t.topPart); newAnimPreset.unlatchedAnimationTop = new TouchAnimationInformation(t.topPart); newAnimPreset.latchedAnimationBase = new TouchAnimationInformation(t.basePart); newAnimPreset.unlatchedAnimationBase = new TouchAnimationInformation(t.basePart); return newAnimPreset; }