示例#1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.tag.CompareTo("Wall") == 0)
        {
            //print("wall in:" + other.name);
            //make sure the encountered wall woulden't be released
            if (releasedWall == other.gameObject)
            {
                releasedWall = null;
            }
            //check if this wall isn't covered by other walls
            Slider_Controller slider_Con = other.gameObject.GetComponent <Slider_Controller>();
            if (other.gameObject.transform.GetChild(0).gameObject.activeSelf)
            {
                if (!solvedWallList.Contains(other.gameObject))
                {
                    Animator states = statesController.Allocate_wall(other.gameObject);
                    //solvedWallList.Add(other.gameObject);
                    int counter = states.GetInteger("NearWallCounter") + 1;
                    if (counter > 100)
                    {
                        counter = 100;
                    }
                    states.SetInteger("NearWallCounter", counter);
                }
            }

            /*if(states != null)
             * {
             *  int counter = states.GetInteger("NearWallCounter") + 2;
             *  if (counter > 100)
             *      counter = 100;
             *  states.SetInteger("NearWallCounter", counter);
             * }*/
        }
    }