Exemple #1
0
 void OnWallActive(WallPlane _wallPlane)
 {
     this.wallPlane = _wallPlane;
 }
Exemple #2
0
 void Start()
 {
     wallPlane = GetComponent<WallPlane>();
 }
Exemple #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("wall"))
        {
            if (other.GetComponent <WallPlane>() != null)
            {
                WallPlane theWallObject = other.GetComponent <WallPlane>();
                switch (theWallObject.m_planeType)
                {
                case WallPlane.m_Plane.Block:
                    playerStatus.SetCurrentHealth(healthDamage);
                    break;

                case WallPlane.m_Plane.Running:
                    if (playerStatus.currentPose == PlayerStatus.PlayerPose.Running)
                    {
                        playerStatus.SetPlayerScore(scoreRate);
                    }
                    else
                    {
                        playerStatus.SetCurrentHealth(healthDamage);
                    }
                    break;

                case WallPlane.m_Plane.PoseUp:
                    if (playerStatus.currentPose == PlayerStatus.PlayerPose.Up)
                    {
                        playerStatus.SetPlayerScore(scoreRate);
                    }
                    else
                    {
                        playerStatus.SetCurrentHealth(healthDamage);
                    }
                    break;

                case WallPlane.m_Plane.PoseDown:
                    if (playerStatus.currentPose == PlayerStatus.PlayerPose.Down)
                    {
                        playerStatus.SetPlayerScore(scoreRate);
                    }
                    else
                    {
                        playerStatus.SetCurrentHealth(healthDamage);
                    }
                    break;

                case WallPlane.m_Plane.PoseLeft:
                    if (playerStatus.currentPose == PlayerStatus.PlayerPose.Left)
                    {
                        playerStatus.SetPlayerScore(scoreRate);
                    }
                    else
                    {
                        playerStatus.SetCurrentHealth(healthDamage);
                    }
                    break;

                case WallPlane.m_Plane.PoseRight:
                    if (playerStatus.currentPose == PlayerStatus.PlayerPose.Right)
                    {
                        playerStatus.SetPlayerScore(scoreRate);
                    }
                    else
                    {
                        playerStatus.SetCurrentHealth(healthDamage);
                    }
                    break;
                }
            }
        }

        if (other.tag == "Jumpwall")
        {
            playerStatus.SetCurrentHealth(healthDamage);
        }
    }
Exemple #4
0
    private void OnTriggerEnter(Collider other)
    {
        if (!m_canNotDamage)
        {
            if (other.tag == "wall")
            {
                if (other.GetComponent <WallPlane>() != null)
                {
                    WallPlane theWallObject = other.GetComponent <WallPlane>();
                    if (theWallObject.m_planeType == WallPlane.m_Plane.Block)
                    {
                        {
                            LoseHealth();
                        }
                    }
                    if (theWallObject.m_planeType == WallPlane.m_Plane.Running)
                    {
                        if (myPose == m_myPose.Running)
                        {
                            AddScore();
                        }
                        else
                        {
                            LoseHealth();
                        }
                    }
                    if (theWallObject.m_planeType == WallPlane.m_Plane.PoseUp)
                    {
                        if (myPose == m_myPose.YogaUp)
                        {
                            AddScore();
                        }
                        else
                        {
                            LoseHealth();
                        }
                    }
                    if (theWallObject.m_planeType == WallPlane.m_Plane.PoseDown)
                    {
                        if (myPose == m_myPose.SpiltFoot)
                        {
                            AddScore();
                        }
                        else
                        {
                            LoseHealth();
                        }
                    }
                    if (theWallObject.m_planeType == WallPlane.m_Plane.PoseRight)
                    {
                        if (myPose == m_myPose.Mickeal)
                        {
                            AddScore();
                        }
                        else
                        {
                            LoseHealth();
                        }
                    }
                    if (theWallObject.m_planeType == WallPlane.m_Plane.PoseLeft)
                    {
                        if (myPose == m_myPose.Wiifit)
                        {
                            AddScore();
                        }
                        else
                        {
                            LoseHealth();
                        }
                    }
                    //m_splineInterpolator.enabled = false;
                }
            }

            if (other.tag == "Jumpwall")
            {
                LoseHealth();
            }
        }
    }