public void OnEditorDirectionChange() { drawerOrientation = directional.InitialOrientation; int spriteVariant = GetSpriteDirectionVariant(); drawerSpriteHandler.ChangeSprite((int)DrawerState.Shut); drawerSpriteHandler.ChangeSpriteVariant(spriteVariant); }
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); }
private void SyncSheetVariant(int oldSheetVar, int newSheetVar) { spriteVariant = 0; spriteHandler.ChangeSpriteVariant(0); spriteSheetVariant = newSheetVar; spriteHandler.ChangeSprite(spriteSheetVariant); pick.RefreshUISlotImage(); }
protected IEnumerator AnimateSides() { while (IsRolling) { faceOverlayHandler.ChangeSpriteVariant(Random.Range(0, sides)); yield return(WaitFor.Seconds(0.1f)); } }
private void RefreshSprites() { if (this == null) { return; } spriteHandler.ChangeSprite((int)CurrentStatus); var variant = (int)CurrentDirection; spriteHandler.ChangeSpriteVariant(variant); }
private void OnStart() { registerTile = GetComponent <RegisterTile>(); CurrentDirection = MappedDirection; SyncInverted = Inverted; if (isServer) { UpdateDirection(CurrentDirection); } spriteHandler.ChangeSprite((int)CurrentStatus); spriteHandler.ChangeSpriteVariant((int)CurrentDirection); }
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); }
public virtual void UpdateSprite() { if (spriteHandler != null) { spriteHandler.ChangeSpriteVariant(referenceOffset, false); } }
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); }
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); }
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); }
public void Pool() { IconBackground.ChangeSpriteVariant(0, false); IconFront.ChangeSpriteVariant(0, false); IconBackground.SetSpriteSO(DefaultIconBackground, Network: false); IconFront.PushClear(false); this.gameObject.SetActive(false); }
public void Pool() { IconBackground.ChangeSpriteVariant(0); IconFront.ChangeSpriteVariant(0); IconBackground.SetInfo(DefaultIconBackground.Data); IconFront.PushClear(); this.gameObject.SetActive(false); }
/// <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; }
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); } }
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; } }
public void OnSpawnServer(SpawnInfo info) { // Roll for the big bell if (Random.value <= 0.005) { RingSound = BigBellRingSound; BellSpriteRenderer.ChangeSpriteVariant(1); } }
private void UpdateSpriteOrientation() { int spriteVariant = (int)GetSpriteDirection(); drawerSpriteHandler.ChangeSpriteVariant(spriteVariant); if (traySpriteHandler != null) { traySpriteHandler.ChangeSpriteVariant(spriteVariant); } }
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); } }
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); } }
public void UpdateSprite() { if (spriteHandler != null) { if (spriteHandler.Infos != null) { spriteHandler.ChangeSpriteVariant(referenceOffset); } } }
public override void Setsprite() { if (IsBent) //This assumes that the connections never get changed around/rotated { SpriteHandler.ChangeSpriteVariant(BentVariantLocation); } else { SpriteHandler.ChangeSpriteVariant(StraightVariantLocation); } }
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; } }
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); }
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); } } }
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); }
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); }
private void UpdateSpriteDirection() { int spriteVariant = GetSpriteDirectionVariant(); drawerSpriteHandler.ChangeSpriteVariant(spriteVariant); traySpriteHandler.ChangeSpriteVariant(spriteVariant); }
public void SetRotation(int newValue) { RelatedSpriteRenderer.ChangeSpriteVariant(newValue); }