コード例 #1
0
    public Vector3 GetPlacePosition(KeyPlaces place)
    {
        switch (place)
        {
        case KeyPlaces.FLAG:
            return(ConvertToZeroYVector(flagPlace.transform.position));

        case KeyPlaces.SPAWN:
            return(ConvertToZeroYVector(spawnPlace.transform.position));

        case KeyPlaces.CENTER:
            return(ConvertToZeroYVector(centerPlace.transform.position));

        case KeyPlaces.FRONT:
            return(ConvertToZeroYVector(frontPlace.transform.position));

        case KeyPlaces.PYLON:
            return(ConvertToZeroYVector(pylonPlace.transform.position));

        case KeyPlaces.CAMPER:
            return(ConvertToZeroYVector(camperPlace.transform.position));

        case KeyPlaces.POWER_UP:
            return(ConvertToZeroYVector(powerUpPlace.transform.position));
        }

        return(centerPlace.transform.position);
    }
コード例 #2
0
 public float GetPlaceDistance(Vector3 pos, KeyPlaces place)
 {
     return(Vector3.Distance(ConvertToZeroYVector(pos), ConvertToZeroYVector(GetPlacePosition(place))));
 }