Exemplo n.º 1
0
        private void updateArrowHead(VisibilityController.Visibility vis)
        {
            if (realArrowHead == null)
            {
                realArrowHead = (GameObject)Instantiate(arrowHead, transform.position, Quaternion.identity);

                Vector2 nodeOnePosition = new Vector2(Edge.nodeOne.transform.position.x, Edge.nodeOne.transform.position.y);
                Vector2 nodeTwoPosition = new Vector2(Edge.nodeTwo.transform.position.x, Edge.nodeTwo.transform.position.y);
                Vector2 edgeVector      = nodeTwoPosition - nodeOnePosition;
                float   edgeAngle       = Vector2.Angle(Vector2.right, edgeVector);
                if (Vector3.Cross(Vector2.right, edgeVector).z < 0)
                {
                    edgeAngle *= -1;
                }
                realArrowHead.transform.Rotate(Vector3.forward, edgeAngle);
            }

            realArrowHead.SetActive(viewAsOwned(vis));

            EdgeData.EdgeDirection simplePrev = (prevDirection == EdgeData.EdgeDirection.TwoToOne ? EdgeData.EdgeDirection.TwoToOne : EdgeData.EdgeDirection.OneToTwo);
            EdgeData.EdgeDirection simpleDir  = (Edge.direction == EdgeData.EdgeDirection.TwoToOne ? EdgeData.EdgeDirection.TwoToOne : EdgeData.EdgeDirection.OneToTwo);
            if (simplePrev != simpleDir)
            {
                realArrowHead.transform.Rotate(Vector3.forward, 180);
                prevDirection = Edge.direction;
            }

            updateVisibilityRendering();
        }
Exemplo n.º 2
0
    private void updateVisibility(VisibilityController.Visibility vis)
    {
        bool owned = viewAsOwned(vis);

        setNormalSprite(owned ? ownedNormalSprite : normalSprite);
        setHighlightedSprite(owned ? ownedHighlightSprite : highlightSprite);
    }
Exemplo n.º 3
0
 public override bool viewAsOwned(VisibilityController.Visibility visibility)
 {
     return(false);
 }
Exemplo n.º 4
0
 override public bool viewAsOwned(VisibilityController.Visibility visibility)
 {
     return(isClick);
 }
Exemplo n.º 5
0
 public abstract bool viewAsOwned(VisibilityController.Visibility visibility);
Exemplo n.º 6
0
        public override bool viewAsOwned(VisibilityController.Visibility visibility)
        {
            bool isPrivate = visibility == VisibilityController.Visibility.Private;

            return(isPrivate && Node.Owner == turnController.CurrentPlayer);
        }
Exemplo n.º 7
0
 override public bool viewAsOwned(VisibilityController.Visibility visibility)
 {
     return(visibility == VisibilityController.Visibility.Private);
 }