Game Development Reference
In-Depth Information
052 ScriptableWizard.DisplayWizard("Create
Plane",typeof(CreateQuad));
053 }
054
055 //------------------------------------------------
056 //Function called when window is created
057 void OnEnable()
058 {
059 //Call selection change
060 OnSelectionChange();
061 }
062 //------------------------------------------------
063 //Called 10 times per second
064 void OnInspectorUpdate()
065 {
066 switch(Anchor)
067 {
068 //Anchor is set to top-left
069 case AnchorPoint.TopLeft:
070 AnchorX = 0.0f * Width;
071 AnchorY = 1.0f * Height;
072 break;
073
074 //Anchor is set to top-middle
075 case AnchorPoint.TopMiddle:
076 AnchorX = 0.5f * Width;
077 AnchorY = 1.0f * Height;
078 break;
079
080 //Anchor is set to top-right
081 case AnchorPoint.TopRight:
082 AnchorX = 1.0f * Width;
083 AnchorY = 1.0f * Height;
084 break;
085
086 //Anchor is set to right-middle
087 case AnchorPoint.RightMiddle:
088 AnchorX = 1.0f * Width;
089 AnchorY = 0.5f * Height;
090 break;
091
092 //Anchor is set to Bottom-Right
093 case AnchorPoint.BottomRight:
094 AnchorX = 1.0f * Width;
 
Search WWH ::




Custom Search