コード例 #1
0
 /// <summary>
 /// Start inventory closing animation
 /// </summary>
 public void CloseInventory()
 {
     this.animationState = InventoryAnimationStates.CLOSING;
 }
コード例 #2
0
    /// <summary>
    /// Opening inventory panel with fading feature
    /// </summary>
    /// <param name="deltaT">time value</param>
    private void StepOpeningAnimation(float deltaT)
    {
        var newAlpha = Mathf.SmoothStep(this.canvasGroup.alpha, 1.1f, deltaT * animationSpeed);
        this.canvasGroup.alpha = newAlpha;

        if(newAlpha >= 1.0f) {
            this.SetInventoryState(true);
            this.animationState = InventoryAnimationStates.NONE;
        }
    }
コード例 #3
0
    // Use this for initialization
    private void Start()
    {
        this.animationState = InventoryAnimationStates.NONE;
        this.layoutGroup = this.gameObject.GetComponent<GridLayoutGroup>();
        this.canvasGroup = this.gameObject.GetComponent<CanvasGroup>();

        var responsiveUtil = this.gameObject.GetComponent<ResponsiveUtil>();
        if(responsiveUtil != null)
            responsiveUtil.CalculateSize();

        this.InitInventoryPanel();
        this.PopulateSlots();
        this.PopulateItems();
    }
コード例 #4
0
    /// <summary>
    /// Closing inventory panel with fading feature
    /// </summary>
    /// <param name="deltaT">time value</param>
    private void StepClosingAnimation(float deltaT)
    {
        var newAlpha = Mathf.SmoothStep(this.canvasGroup.alpha, -0.1f, deltaT * animationSpeed);
        this.canvasGroup.alpha = newAlpha;

        if(newAlpha <= 0.0f) {
            this.SetInventoryState(false);
            this.animationState = InventoryAnimationStates.NONE;
        }
    }
コード例 #5
0
 /// <summary>
 /// Start inventory opening animation
 /// </summary>
 public void OpenInventory()
 {
     this.animationState = InventoryAnimationStates.OPENING;
 }