Exemple #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();
        }
    private void updateVisibility(VisibilityController.Visibility vis)
    {
        bool owned = viewAsOwned(vis);

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

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