예제 #1
0
    ////////////////////////////////////////
    //	On click
    //void OnMouseDown(){
    void switchOnFinger()
    {
        //We change the polarity
        currPolarity = !currPolarity;



        //We check for the current polarity state
        switch (currPolarity)
        {
        //Becomes red
        case true:

            //We change rhe color on the fly
            Material matRed = Resources.Load(refRedMat, typeof(Material)) as Material;
            this.renderer.material = matRed;

            //We change the polarState
            thePolar = polarState.red;

            break;


        //Becomes blue
        case false:
            //We change rhe color on the fly
            Material matBlue = Resources.Load(refBlueMat, typeof(Material)) as Material;
            this.renderer.material = matBlue;

            //We change the polarState
            thePolar = polarState.blue;

            break;
        }
    }
예제 #2
0
 ////////////////////////////////////////
 //	Start
 void Start()
 {
     thePolar = polarState.blue;
 }