Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        MapData            currentMapData = MapData.GetInstance();
        MapRegion          currentRegion  = currentMapData.GetRegionData();
        MapPointOfInterest currentPOI     = currentMapData.GetPointOfInterestData();

        int crowdSize = 0;

        if (currentPOI == null)
        {
            crowdSize = crowdSize = currentMapData.GetCrowdSize();             //Crowd of enemies,
        }
        else
        {
            crowdSize = Random.Range(1, 8); //Points of interest - set random crowd size?
        }
        if (currentPOI == null)             // ran into crowd of people.
        //enable generic backround
        {
            SpriteRenderer ParkR = Park.GetComponent <SpriteRenderer> ();
            ParkR.enabled = true;
        }
        else
        {
            //Specific (port/graveyard etc)
            MapObject.PointOfInterestType type = currentPOI.m_PointOfInterestType;
            switch (type)
            {
            case MapObject.PointOfInterestType.CLIFF_EDGE:
                SpriteRenderer CliffR = Cliff.GetComponent <SpriteRenderer> ();
                CliffR.enabled = true;
                break;

            case MapObject.PointOfInterestType.GRAVEYARD_CHURCH:
                SpriteRenderer GraveyardR = Graveyard.GetComponent <SpriteRenderer> ();
                GraveyardR.enabled = true;
                break;

            case MapObject.PointOfInterestType.GANG_HEADQUARTERS:
                SpriteRenderer GangHQR = GangHQ.GetComponent <SpriteRenderer> ();
                GangHQR.enabled = true;
                break;

            case MapObject.PointOfInterestType.NIGHTCLUB:
                SpriteRenderer NightclubR = Club.GetComponent <SpriteRenderer> ();
                NightclubR.enabled = true;
                break;

            case MapObject.PointOfInterestType.PARK:
                SpriteRenderer ParkR = Park.GetComponent <SpriteRenderer> ();
                ParkR.enabled = true;
                break;

            case MapObject.PointOfInterestType.TRAIN_STATION:
                SpriteRenderer SubwayR = Subway.GetComponent <SpriteRenderer> ();
                SubwayR.enabled = true;
                break;
            }
        }
    }
Ejemplo n.º 2
0
    public MapPointOfInterest GetPointOfInterestData()
    {
        if (debug)
        {
            _currentPointOfInterest = new MapPointOfInterest();
            _currentPointOfInterest.m_PointOfInterestType = MapObject.PointOfInterestType.CLIFF_EDGE;
        }

        return(_currentPointOfInterest);
    }
Ejemplo n.º 3
0
    void Start()
    {
        spriteRenderer = GetComponentInChildren <SpriteRenderer> ();

        MapData            currentMapData = MapData.GetInstance();
        MapRegion          currentRegion  = currentMapData.GetRegionData();
        MapPointOfInterest currentPOI     = currentMapData.GetPointOfInterestData();

        int crowdSize = 0;

        if (currentPOI == null)
        {
            crowdSize = crowdSize = currentMapData.GetCrowdSize();             //Crowd of enemies,
        }
        else
        {
            crowdSize = Random.Range(1, 8); //Points of interest - set random crowd size?
        }
        if (currentPOI == null)             // ran into crowd of people.
        //enable generic backround
        {
            spriteRenderer.sprite = citySprite;
        }
        else
        {
            //Specific (port/graveyard etc)
            MapObject.PointOfInterestType type = currentPOI.m_PointOfInterestType;
            switch (type)
            {
            case MapObject.PointOfInterestType.CLIFF_EDGE:
                spriteRenderer.sprite = cliffSprite;
                break;

            case MapObject.PointOfInterestType.GRAVEYARD_CHURCH:
                spriteRenderer.sprite = graveSprite;
                break;

            case MapObject.PointOfInterestType.GANG_HEADQUARTERS:
                spriteRenderer.sprite = hqSprite;
                break;

            case MapObject.PointOfInterestType.NIGHTCLUB:
                spriteRenderer.sprite = clubSprite;
                break;

            case MapObject.PointOfInterestType.PARK:
                spriteRenderer.sprite = parkSprite;
                break;
            }
        }
    }
Ejemplo n.º 4
0
    protected override void Awake()
    {
        base.Awake();
        _planetSpriteRenderer = planetRenderer.GetComponent <SpriteRenderer>();
        _planetNameText       = planetRenderer.GetComponentInChildren <TextMeshProUGUI>();
        _planetAnimator       = planetRenderer.GetComponent <Animator>();
        _planetLabel          = planetRenderer.GetComponentInChildren <Image>();
        _planetMask           = planetRenderer.GetComponent <SpriteMask>();
        _planetCanvas         = planetRenderer.GetComponent <Canvas>();
        _mapPointOfInterest   = GetComponentInChildren <MapPointOfInterest>();

        PlanetFound = false;
        _planetAnimator.SetBool("Visible", false);
        _planetNameText.enabled = false;
    }
Ejemplo n.º 5
0
 public void SetStartingState(MapPointOfInterest point, bool isVisible)
 {
     _mapPointOfInterest.SetStartingState(isVisible, this);
 }
Ejemplo n.º 6
0
 public void RevealPoint(MapPointOfInterest point)
 {
     point.HideMapPoint();
 }
Ejemplo n.º 7
0
 public void SetData(MapRegion currentR, MapPointOfInterest currentPOI, int crowdSize)
 {
     _currentRegion          = currentR;
     _currentPointOfInterest = currentPOI;
     _currentCrowdSize       = crowdSize;
 }