示例#1
0
 private void LoadFromExisting()
 {
     icon = GPS.gpsIconParent.transform.GetChild(0).GetComponent <UnityEngine.UI.Image>();
     icon.transform.SetParent(Minimap.miniMap);
     icon.rectTransform.sizeDelta     = Minimap.mInstance.mask.sizeDelta * 0.035f;
     icon.rectTransform.localPosition = Minimap.GetPositionInMap(boxCollider.transform.position);
 }
示例#2
0
 private void InstantiateNew()
 {
     icon = Object.Instantiate(GPS.gpsNavigationPrefab).GetComponent <UnityEngine.UI.Image>();
     icon.transform.SetParent(Minimap.miniMap);
     icon.rectTransform.sizeDelta     = Minimap.mInstance.mask.sizeDelta * 0.035f;
     icon.rectTransform.localPosition = Minimap.GetPositionInMap(boxCollider.transform.position);
 }
示例#3
0
        private void Update()
        {
            var dir          = Minimap.GetPositionInMap(image.rectTransform.position + Vector3.forward) - Minimap.GetPositionInMap(image.rectTransform.position);
            var angle        = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
            var lookRotation = Quaternion.AngleAxis(angle - 90, Vector3.forward);

            image.rectTransform.rotation = lookRotation;

            image.rectTransform.localPosition = Minimap.GetPositionInMap(resurrectionTombstone.transform);
        }