コード例 #1
0
        public void ClearPreset()
        {
            if(presetToShow == null)
                return;
		
            presetToShow = null;
            ResetPos();
        }
コード例 #2
0
        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;
            }

        } 
コード例 #3
0
 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();
     }
 }
コード例 #4
0
        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();
        }
コード例 #5
0
            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;
                    }
                } 
            }
コード例 #6
0
        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;
        }