void SetShieldDirection(CharacterMovementView.ShieldDirection direction) { transform.localScale = Vector3.one; switch (direction) { case CharacterMovementView.ShieldDirection.Front: m_Renderer.sprite = VisualsFront; m_MovementView.SetSortingOrderOfShield(150); break; case CharacterMovementView.ShieldDirection.Back: m_Renderer.sprite = VisualsBack; m_MovementView.SetSortingOrderOfShield(-1); break; case CharacterMovementView.ShieldDirection.Left: m_Renderer.sprite = VisualsSide; m_MovementView.SetSortingOrderOfShield(-1); break; case CharacterMovementView.ShieldDirection.Right: transform.localScale = new Vector3(-1, 1, 1); m_Renderer.sprite = VisualsSide; m_MovementView.SetSortingOrderOfShield(150); break; } }
private void SetShieldDirection(CharacterMovementView.ShieldDirection direction) { transform.localScale = Vector3.one; //Actually set the shield position including the sorting order and the sprite to be used switch (direction) { case CharacterMovementView.ShieldDirection.Front: m_Renderer.sprite = VisualsFront; m_MovementView.SetSortingOrderOfShield(150); break; case CharacterMovementView.ShieldDirection.Back: m_Renderer.sprite = VisualsBack; m_MovementView.SetSortingOrderOfShield(50); break; case CharacterMovementView.ShieldDirection.Left: transform.localScale = new Vector3(-1, 1, 1); m_Renderer.sprite = VisualsSide; m_MovementView.SetSortingOrderOfShield(50); break; case CharacterMovementView.ShieldDirection.Right: m_Renderer.sprite = VisualsSide; m_MovementView.SetSortingOrderOfShield(150); break; case CharacterMovementView.ShieldDirection.FrontHalf: m_Renderer.sprite = VisualsFrontHalf; m_MovementView.SetSortingOrderOfShield(150); break; case CharacterMovementView.ShieldDirection.BackHalf: m_Renderer.sprite = VisualsBackHalf; m_MovementView.SetSortingOrderOfShield(50); break; } }
public void ForceShieldDirection(CharacterMovementView.ShieldDirection direction) { m_IsDirectionForced = true; m_ForcedDirection = direction; }
public void ForceShieldDirection( CharacterMovementView.ShieldDirection shieldDirection ) { m_IsDirectionForced = true; m_ForcedDirection = shieldDirection; }
public void ForceShieldDirection(CharacterMovementView.ShieldDirection shieldDirection) { //This is called by the CharacterMovementView m_IsDirectionForced = true; m_ForcedDirection = shieldDirection; }