Example #1
0
 void SetBounds(CarbonState state)
 {
     if (this.carbonState == CarbonState.ATMOSPHERIC)
     {
         carbonBoundRT = skyPanel.GetComponent <RectTransform>();
         workingPanel  = skyPanel;
     }
     if (this.carbonState == CarbonState.UNDERGROUND)
     {
         carbonBoundRT = groundPanel.GetComponent <RectTransform>();
         workingPanel  = groundPanel;
     }
     boundMin.x = workingPanel.transform.position.x - carbonBoundRT.rect.width / 2;
     boundMin.y = workingPanel.transform.position.y - carbonBoundRT.rect.height / 2;
     boundMax.x = workingPanel.transform.position.x + carbonBoundRT.rect.width / 2;
     boundMax.y = workingPanel.transform.position.y + carbonBoundRT.rect.height / 2;
 }
Example #2
0
 void SetState(CarbonState state)
 {
     this.carbonState =  state;
     SetBounds(state);
 }
Example #3
0
 void SetBounds(CarbonState state)
 {
     if (this.carbonState == CarbonState.ATMOSPHERIC){
         carbonBoundRT = skyPanel.GetComponent<RectTransform>();
         workingPanel = skyPanel;
     }
     if (this.carbonState == CarbonState.UNDERGROUND){
         carbonBoundRT = groundPanel.GetComponent<RectTransform>();
         workingPanel = groundPanel;
     }
     boundMin.x = workingPanel.transform.position.x - carbonBoundRT.rect.width/2;
     boundMin.y = workingPanel.transform.position.y - carbonBoundRT.rect.height/2;
     boundMax.x = workingPanel.transform.position.x + carbonBoundRT.rect.width/2;
     boundMax.y = workingPanel.transform.position.y + carbonBoundRT.rect.height/2;
 }
Example #4
0
 //because the canvas is working in world space with an absolute width and height
 //I'll have to change things around.
 public void Initialize(Vector2 startingLocation, CarbonState state)
 {
     this.originalLocation = startingLocation;
     this.carbonState = state;
     print("original Location: " + originalLocation);
 }
Example #5
0
    //because the canvas is working in world space with an absolute width and height
    //I'll have to change things around.


    public void Initialize(Vector2 startingLocation, CarbonState state)
    {
        this.originalLocation = startingLocation;
        this.carbonState      = state;
        print("original Location: " + originalLocation);
    }
Example #6
0
 void SetState(CarbonState state)
 {
     this.carbonState = state;
     SetBounds(state);
 }