示例#1
0
    private void OnTriggerExit(Collider other)
    {
        if (transform.name == "ColliderFirst")
        {
            var.x.flag2 = false;
        }

        if (transform.name == "ColliderSecond")
        {
            var.x.flag1 = false;
        }
        //ako je lijevi znak aktivan primjeni njegova pravila
        if (LeftSign.isActive)
        {
            LeftSign.checkIsRight(transform);
        }
        if (LeftUp.isActive)
        {
            LeftUp.checkIsRight(transform);
        }
        if (LeftRight.isActive)
        {
            LeftRight.checkIsRight(transform);
        }
        if (UP.isActive)
        {
            UP.checkIsRight(transform);
        }
        //ako je desni znak aktivan primjeni njegova pravila

        /* if (RightSign.isActive)
         * {
         *   LeftSign.checkIsRight(transform);
         * }*/

        if (transform.GetComponentInParent <IntersectionWrongWay>() != null)
        {
            intersection = transform.GetComponentInParent <IntersectionWrongWay>();

            if (transform.name == "ColliderIntersection")
            {
                intersection.setAllFalse();
                UP.isActive        = false;
                LeftSign.isActive  = false;
                RightSign.isActive = false;
                RightUp.isActive   = false;
                LeftUp.isActive    = false;
                LeftRight.isActive = false;
                UP.isActive        = false;
            }
        }

        if (transform.name == "ColliderStop")
        {
            if (!StopSign.timerDone)
            {
                Debug.Log("NISI STAO NA STOP");
            }
            StopSign.stopSignActive = false;
        }
    }