Пример #1
0
    public void MyColorChange()
    {
        if (transform.parent.tag == "P1")
        {
            headCol = headOne.GetComponent <HeadCollision>();
            gameObject.GetComponent <Renderer>().material.color = headCol.gameObject.GetComponent <Renderer>().material.color;

            color = gameObject.GetComponent <Renderer>().material.color;
            //color.g = .7f;        Tried to make the other parts a slightly different color, left this unfinished
            //color.b = .7f;
        }
        if (transform.parent.tag == "P2")
        {
            headCol = headTwo.GetComponent <HeadCollision>();
            gameObject.GetComponent <Renderer>().material.color = headCol.gameObject.GetComponent <Renderer>().material.color;

            color = gameObject.GetComponent <Renderer>().material.color;
            //color.g = 255;        Tried to make the other parts a slightly different color, left this unfinished
            //color.b = 255;
        }
    }
Пример #2
0
 void Awake()
 {
     instance = this;
 }