Beispiel #1
0
        private void EditorUpdate()
        {
            NodeNameCanvas.worldCamera = Camera.main;
            NodeNameText.text          = name;
            NodeImage.sprite           = MapPrefabsConfig.Get().MapNodeIcons.Find(x => x.Type == Type)?.Icon;

            NeighbourNodes.Remove(this);
            NeighbourNodes.RemoveAll(node => node == null);
            NeighbourNodes = NeighbourNodes.Distinct().ToList();
        }
Beispiel #2
0
        private void Awake()
        {
            NodesList.AddRange(GetComponentsInChildren <MapNodeVisual>());
            CurrentNode = NodesList.Find(node => node.Type == NodeType.StartNode);
            Player      = Instantiate(MapPrefabsConfig.Get().MapPlayerPrefab);
            Player.transform.position = CurrentNode.transform.position;

            foreach (var node in NodesList)
            {
                node.OnNodePressed += TrySendPlayerToNode;
            }
        }