Пример #1
0
	public void OnEditorDirectionChange()
	{
		drawerOrientation = directional.InitialOrientation;
		int spriteVariant = GetSpriteDirectionVariant();
		drawerSpriteHandler.ChangeSprite((int)DrawerState.Shut);
		drawerSpriteHandler.ChangeSpriteVariant(spriteVariant);
	}
Пример #2
0
        private void RefreshSprites()
        {
            if (this == null)
            {
                return;
            }
            spriteHandler.ChangeSprite((int)CurrentStatus);
            var variant = (int)CurrentDirection;

            switch (variant)
            {
            case 8:
                variant = 4;
                break;

            case 9:
                variant = 5;
                break;

            case 10:
                variant = 6;
                break;

            case 11:
                variant = 7;
                break;
            }

            spriteHandler.ChangeSpriteVariant(variant);
        }
Пример #3
0
 private void SyncSheetVariant(int oldSheetVar, int newSheetVar)
 {
     spriteVariant = 0;
     spriteHandler.ChangeSpriteVariant(0);
     spriteSheetVariant = newSheetVar;
     spriteHandler.ChangeSprite(spriteSheetVariant);
     pick.RefreshUISlotImage();
 }
Пример #4
0
 protected IEnumerator AnimateSides()
 {
     while (IsRolling)
     {
         faceOverlayHandler.ChangeSpriteVariant(Random.Range(0, sides));
         yield return(WaitFor.Seconds(0.1f));
     }
 }
Пример #5
0
        private void RefreshSprites()
        {
            if (this == null)
            {
                return;
            }
            spriteHandler.ChangeSprite((int)CurrentStatus);
            var variant = (int)CurrentDirection;

            spriteHandler.ChangeSpriteVariant(variant);
        }
Пример #6
0
    private void OnStart()
    {
        registerTile     = GetComponent <RegisterTile>();
        CurrentDirection = MappedDirection;

        SyncInverted = Inverted;

        if (isServer)
        {
            UpdateDirection(CurrentDirection);
        }

        spriteHandler.ChangeSprite((int)CurrentStatus);
        spriteHandler.ChangeSpriteVariant((int)CurrentDirection);
    }
Пример #7
0
    public override void OnDirectionChange(Orientation direction)
    {
        int referenceOffset = 0;

        if (direction == Orientation.Down)
        {
            referenceOffset = 0;
        }

        if (direction == Orientation.Up)
        {
            referenceOffset = 1;
        }

        if (direction == Orientation.Right)
        {
            referenceOffset = 2;
        }

        if (direction == Orientation.Left)
        {
            referenceOffset = 3;
        }
        baseSpriteHandler.ChangeSpriteVariant(referenceOffset);
        OverlySpriteHandler.ChangeSpriteVariant(referenceOffset);
    }
Пример #8
0
 public virtual void UpdateSprite()
 {
     if (spriteHandler != null)
     {
         spriteHandler.ChangeSpriteVariant(referenceOffset, false);
     }
 }
Пример #9
0
    public virtual void OnDirectionChange(Orientation direction)
    {
        int referenceOffset = 0;

        if (direction == Orientation.Down)
        {
            referenceOffset = 0;
        }

        if (direction == Orientation.Up)
        {
            referenceOffset = 1;
        }

        if (direction == Orientation.Right)
        {
            referenceOffset = 2;
        }

        if (direction == Orientation.Left)
        {
            referenceOffset = 3;
        }

        if (SpriteOrder != null)
        {
            if (SpriteOrder.Orders.Count > referenceOffset)
            {
                spriteRenderer.sortingOrder = SpriteOrder.Orders[referenceOffset];
            }
        }

        baseSpriteHandler.ChangeSpriteVariant(referenceOffset, false);
    }
Пример #10
0
    public override void OnDirectionChange(OrientationEnum direction)
    {
        int referenceOffset = 0;

        if (direction == OrientationEnum.Down_By180)
        {
            referenceOffset = 0;
        }

        if (direction == OrientationEnum.Up_By0)
        {
            referenceOffset = 1;
        }

        if (direction == OrientationEnum.Right_By90)
        {
            referenceOffset = 2;
        }

        if (direction == OrientationEnum.Left_By270)
        {
            referenceOffset = 3;
        }

        baseSpriteHandler.ChangeSpriteVariant(referenceOffset);
        OverlySpriteHandler.ChangeSpriteVariant(referenceOffset);
    }
Пример #11
0
	public void UpdateData(string InNew)
	{
		if (string.IsNullOrEmpty(InNew)) return;
		Data = InNew;
		SpriteOrder = JsonConvert.DeserializeObject<SpriteOrder>(Data);
		SpriteOrder.Orders.RemoveRange(0, 4);
		if (SpriteOrder != null)
		{
			if (SpriteOrder.Orders.Count > referenceOffset)
			{
				spriteRenderer.sortingOrder = SpriteOrder.Orders[referenceOffset];
			}
		}
		if (baseSpriteHandler == null) return;
		baseSpriteHandler.ChangeSpriteVariant(referenceOffset, false);
	}
Пример #12
0
 public void Pool()
 {
     IconBackground.ChangeSpriteVariant(0, false);
     IconFront.ChangeSpriteVariant(0, false);
     IconBackground.SetSpriteSO(DefaultIconBackground, Network: false);
     IconFront.PushClear(false);
     this.gameObject.SetActive(false);
 }
Пример #13
0
 public void Pool()
 {
     IconBackground.ChangeSpriteVariant(0);
     IconFront.ChangeSpriteVariant(0);
     IconBackground.SetInfo(DefaultIconBackground.Data);
     IconFront.PushClear();
     this.gameObject.SetActive(false);
 }
Пример #14
0
        /// <summary>
        /// Display the overlay animation in the specified direction
        /// </summary>
        /// <param name="direction"></param>
        public void StartOverlay(Orientation direction)
        {
            EnsureInit();

            spriteHandler.ChangeSprite(0);             // Load sprite into SpriteRenderer
            spriteHandler.ChangeSpriteVariant(GetOrientationVariant(direction));
            OverlayActive = true;
        }
Пример #15
0
 public void UpdateSprite()
 {
     // It's possible that UpdateSprite gets called before Awake
     // so try to grab the image here just in case that happens
     if (sprites != null || TryGetComponent(out sprites))
     {
         sprites.ChangeSpriteVariant(referenceOffset, NetWork: false);
     }
 }
Пример #16
0
		private void UpdateSpriteOrientation()
		{
			switch (orientation.AsEnum())
			{
				case OrientationEnum.Up:
					spriteHandler.ChangeSpriteVariant(1);
					break;
				case OrientationEnum.Down:
					spriteHandler.ChangeSpriteVariant(0);
					break;
				case OrientationEnum.Left:
					spriteHandler.ChangeSpriteVariant(3);
					break;
				case OrientationEnum.Right:
					spriteHandler.ChangeSpriteVariant(2);
					break;
			}
		}
Пример #17
0
 public void OnSpawnServer(SpawnInfo info)
 {
     // Roll for the big bell
     if (Random.value <= 0.005)
     {
         RingSound = BigBellRingSound;
         BellSpriteRenderer.ChangeSpriteVariant(1);
     }
 }
Пример #18
0
		private void UpdateSpriteOrientation()
		{
			int spriteVariant = (int)GetSpriteDirection();
			drawerSpriteHandler.ChangeSpriteVariant(spriteVariant);

			if (traySpriteHandler != null)
			{
				traySpriteHandler.ChangeSpriteVariant(spriteVariant);
			}
		}
Пример #19
0
 private void OnDirectionChange(OrientationEnum direction)
 {
     if (OrientationEnum.Down_By180 == direction)
     {
         SpriteHandler.ChangeSpriteVariant(0, networked: false);
     }
     else if (OrientationEnum.Up_By0 == direction)
     {
         SpriteHandler.ChangeSpriteVariant(1, networked: false);
     }
     else if (OrientationEnum.Right_By90 == direction)
     {
         SpriteHandler.ChangeSpriteVariant(2, networked: false);
     }
     else
     {
         SpriteHandler.ChangeSpriteVariant(3, networked: false);
     }
 }
Пример #20
0
 private void OnDirectionChange(Orientation direction)
 {
     if (Orientation.Down == direction)
     {
         SpriteHandler.ChangeSpriteVariant(0, networked: false);
     }
     else if (Orientation.Up == direction)
     {
         SpriteHandler.ChangeSpriteVariant(1, networked: false);
     }
     else if (Orientation.Right == direction)
     {
         SpriteHandler.ChangeSpriteVariant(2, networked: false);
     }
     else
     {
         SpriteHandler.ChangeSpriteVariant(3, networked: false);
     }
 }
Пример #21
0
 public void UpdateSprite()
 {
     if (spriteHandler != null)
     {
         if (spriteHandler.Infos != null)
         {
             spriteHandler.ChangeSpriteVariant(referenceOffset);
         }
     }
 }
Пример #22
0
 public override void Setsprite()
 {
     if (IsBent)            //This assumes that the connections never get changed around/rotated
     {
         SpriteHandler.ChangeSpriteVariant(BentVariantLocation);
     }
     else
     {
         SpriteHandler.ChangeSpriteVariant(StraightVariantLocation);
     }
 }
Пример #23
0
        private void UpdateSpriteOrientation()
        {
            switch (orientation)
            {
            case OrientationEnum.Up_By0:
                spriteHandler.ChangeSpriteVariant(1);
                break;

            case OrientationEnum.Down_By180:
                spriteHandler.ChangeSpriteVariant(0);
                break;

            case OrientationEnum.Left_By90:
                spriteHandler.ChangeSpriteVariant(3);
                break;

            case OrientationEnum.Right_By270:
                spriteHandler.ChangeSpriteVariant(2);
                break;
            }
        }
Пример #24
0
        private void UpdateArrowSprite(Vector3 moveDirection)
        {
            if (moveDirection == Vector3.zero)
            {
                ChangeArrowSprite(ArrowSprite.Direct);
                arrowSpriteHandler.ChangeSpriteVariant(0);                 // No variant for Direct.
                return;
            }

            ArrowSprite newSprite = GetArrowFromMagnitude(moveDirection.magnitude);

            ChangeArrowSprite(newSprite);

            float angle = Mathf.Atan2(moveDirection.y, moveDirection.x) * Mathf.Rad2Deg;
            ArrowSpriteVariant newVariant = GetArrowVariantFromAngle(angle);

            ChangeArrowSpriteVariant(newVariant);
        }
Пример #25
0
 public void UpdateSprite()
 {
     if (spriteHandler != null)
     {
         if (spriteHandler.Infos != null)
         {
             if (SHD)
             {
                 if (spriteType == SpriteHandType.RightHand)
                 {
                     spriteHandler.ChangeSprite((SHD.Infos.VariantIndex * 2) + 1);
                 }
                 else
                 {
                     spriteHandler.ChangeSprite(SHD.Infos.VariantIndex * 2);
                 }
             }
             spriteHandler.ChangeSpriteVariant(referenceOffset);
         }
     }
 }
Пример #26
0
 public override void ServerPerformInteraction(HandApply interaction)
 {
     if (Validations.HasItemTrait(interaction.UsedObject, CommonTraits.Instance.Crowbar))
     {
         if (IsBent)                //This assumes that the connections never get changed around/rotated
         {
             IsBent = false;
             SpriteHandler.ChangeSpriteVariant(StraightVariantLocation);
             Chat.AddExamineMsgFromServer(interaction.Performer,
                                          "You straighten the pipe with the " + interaction.UsedObject.ExpensiveName());
             return;
         }
         else
         {
             IsBent = true;
             SpriteHandler.ChangeSpriteVariant(BentVariantLocation);
             Chat.AddExamineMsgFromServer(interaction.Performer,
                                          "You Bend the pipe with the " + interaction.UsedObject.ExpensiveName());
             return;
         }
     }
     base.ServerPerformInteraction(interaction);
 }
Пример #27
0
    protected void UpdateSpriteDirection()
    {
        int spriteVariant;

        if (drawerOrientation == Orientation.Up)
        {
            spriteVariant = (int)SpriteOrientation.North;
        }
        else if (drawerOrientation == Orientation.Down)
        {
            spriteVariant = (int)SpriteOrientation.South;
        }
        else if (drawerOrientation == Orientation.Left)
        {
            spriteVariant = (int)SpriteOrientation.West;
        }
        else
        {
            spriteVariant = (int)SpriteOrientation.East;
        }

        drawerSpriteHandler.ChangeSpriteVariant(spriteVariant);
        traySpriteHandler.ChangeSpriteVariant(spriteVariant);
    }
 public void ChangeSpriteVariant(int number)
 {
     SpriteHandler.ChangeSpriteVariant(number);
 }
Пример #29
0
	private void UpdateSpriteDirection()
	{
		int spriteVariant = GetSpriteDirectionVariant();
		drawerSpriteHandler.ChangeSpriteVariant(spriteVariant);
		traySpriteHandler.ChangeSpriteVariant(spriteVariant);
	}
Пример #30
0
 public void SetRotation(int newValue)
 {
     RelatedSpriteRenderer.ChangeSpriteVariant(newValue);
 }