Exemple #1
0
    public void ToggleExtendStatus(bool isAnimation = false)
    {
        if (coroutine != null)
        {
            CoroutineTarget.StopCoroutine(coroutine);
        }
        float dstWidth = 0.0f;

        if (isExtended)
        {
            dstWidth = originalWidth;
        }
        else
        {
            dstWidth = extendedWidth;
        }
        if (isAnimation)
        {
            coroutine = CoroutineTarget.StartCoroutine(StartAnimation(dstWidth));
        }
        else
        {
            (transform as RectTransform).sizeDelta = new Vector2(dstWidth, (transform as RectTransform).sizeDelta.y);
        }
        isExtended = !isExtended;
    }
        public void Cast()
        {
            var coroutine0 = new CoroutineTarget();
            var coroutine1 = new CoroutineInt();
            var cast0      = coroutine0 as ICoroutine <object>;
            var cast1      = coroutine1 as ICoroutine <object>;

            Assert.NotNull(cast0);
            Assert.Null(cast1);
        }