Game Development Reference
In-Depth Information
095 AnchorY = 0.0f * Height;
096 break;
097
098 //Anchor is set to Bottom-Middle
099 case AnchorPoint.BottomMiddle:
100 AnchorX = 0.5f * Width;
101 AnchorY = 0.0f * Height;
102 break;
103
104 //Anchor is set to Bottom-Left
105 case AnchorPoint.BottomLeft:
106 AnchorX = 0.0f * Width;
107 AnchorY = 0.0f * Height;
108 break;
109
110 //Anchor is set to Left-Middle
111 case AnchorPoint.LeftMiddle:
112 AnchorX = 0.0f * Width;
113 AnchorY = 0.5f * Height;
114 break;
115
116 //Anchor is set to center
117 case AnchorPoint.Center:
118 AnchorX = 0.5f * Width;
119 AnchorY = 0.5f * Height;
120 break;
121
122 case AnchorPoint.Custom:
123 default:
124 break;
125 }
126 }
127 //------------------------------------------------
128 //Function called when window is updated
129 void OnSelectionChange()
130 {
131 //Check user selection in editor
132 if (Selection.objects != null && Selection.objects.Length
== 1)
133 {
134 //Get path from selected asset
135 AssetFolder = Path.GetDirectoryName(AssetDatabase.
GetAssetPath(Selection.objects[0]));
 
Search WWH ::




Custom Search