void InitMap()
 {
     if (!playerTransform)
     {
         hasMapInit = false;
         Debug.LogError("You must specify the player transform");
     }
     mapRect  = GetComponent <RectTransform> ();
     innerMap = GetComponentInChildren <InnerMap> ();
     if (!innerMap)
     {
         hasMapInit = false;
         Debug.LogError("InnerMap component is missing from children");
     }
     mapArrow = GetComponentInChildren <MapArrow> ();
     if (!mapArrow)
     {
         hasMapInit = false;
         Debug.LogError("MapArrow component is missing from children");
     }
     markerGroup = GetComponentInChildren <MarkerGroup> ();
     if (!markerGroup)
     {
         hasMapInit = false;
         Debug.LogError("MerkerGroup component is missing. It must be a child of InnerMap");
     }
     innerMapRadius = innerMap.getMapRadius();
 }
예제 #2
0
    private void Awake()
    {
        if (!GameManager.Instance)
        {
            FindObjectOfType <GameManager>().Initialize();
        }
        this.playerTransform = GameManager.Instance.Player.transform;
        if (!playerTransform)
        {
            Debug.LogError("You must specify the player transform");
        }

        mapRect = GetComponent <RectTransform>();

        innerMap = GetComponentInChildren <InnerMap>();
        if (!innerMap)
        {
            Debug.LogError("InnerMap component is missing from children");
        }

        mapArrow = GetComponentInChildren <MapArrow>();
        if (!mapArrow)
        {
            Debug.LogError("MapArrow component is missing from children");
        }

        markerGroup = GetComponentInChildren <MarkerGroup>();
        if (!markerGroup)
        {
            Debug.LogError("MerkerGroup component is missing. It must be a child of InnerMap");
        }

        innerMapRadius = innerMap.getMapRadius();
    }
예제 #3
0
    void Awake()
    {
        if (!playerTransform)
        {
            playerTransform = GameObject.FindGameObjectWithTag("Player").transform;
            Debug.LogError("You must specify the player transform");
        }

        mapRect = GetComponent <RectTransform>();

        innerMap = GetComponentInChildren <InnerMap>();
        if (!innerMap)
        {
            Debug.LogError("InnerMap component is missing from children");
        }

        mapArrow = GetComponentInChildren <MapArrow>();
        if (!mapArrow)
        {
            Debug.LogError("MapArrow component is missing from children");
        }

        markerGroup = GetComponentInChildren <MarkerGroup>();
        if (!markerGroup)
        {
            Debug.LogError("MerkerGroup component is missing. It must be a child of InnerMap");
        }

        innerMapRadius = innerMap.getMapRadius();
    }
    public void Load()
    {
        if (!playerTransform)
        {
            if (Camera.main.GetComponent <vThirdPersonCamera>().target == null)
            {
                if (GameController.Instance.IsMultyPlayer())
                {
                    this.gameObject.SetActive(false);
                    return;
                }
            }
            else
            {
                playerTransform = Camera.main.GetComponent <vThirdPersonCamera>().target.transform;
            }
        }

        if (!playerTransform)
        {
            Debug.LogError("You must specify the player transform");
        }

        mapRect = GetComponent <RectTransform>();

        innerMap = GetComponentInChildren <InnerMap>();
        if (!innerMap)
        {
            Debug.LogError("InnerMap component is missing from children");
        }

        mapArrow = GetComponentInChildren <MapArrow>();
        if (!mapArrow)
        {
            Debug.LogError("MapArrow component is missing from children");
        }

        markerGroup = GetComponentInChildren <MarkerGroup>();
        if (!markerGroup)
        {
            Debug.LogError("MerkerGroup component is missing. It must be a child of InnerMap");
        }

        innerMapRadius = innerMap.getMapRadius();
    }
    void Awake()
    {
        if (!playerTransform)
        {
            Debug.LogError("You must specify the player transform");
        }

        mapRect = GetComponent<RectTransform>();

        innerMap = GetComponentInChildren<InnerMap>();
        if (!innerMap)
        {
            Debug.LogError("InnerMap component is missing from children");
        }

        mapArrow = GetComponentInChildren<MapArrow>();
        if (!mapArrow)
        {
            Debug.LogError("MapArrow component is missing from children");
        }

        markerGroup = GetComponentInChildren<MarkerGroup>();
        if (!markerGroup)
        {
            Debug.LogError("MerkerGroup component is missing. It must be a child of InnerMap");
        }

        innerMapRadius = innerMap.getMapRadius();
    }