Esempio n. 1
0
    public override void Reset()
    {
        switch (transType)
        {
        case E_ObjCmdTransType.Local:
            gameObject.transform.localScale = lastScale;
            break;

        case E_ObjCmdTransType.Global:
            GameObjectExtend.SetLossyScale(gameObject.transform, lastScale);
            break;
        }
    }
Esempio n. 2
0
    override protected bool Cmd(Vector3 p_arg)
    {
        switch (transType)
        {
        case E_ObjCmdTransType.Local:
            lastScale = gameObject.transform.localScale;
            break;

        case E_ObjCmdTransType.Global:
            lastScale = gameObject.transform.lossyScale;
            break;

        default:
            lastScale = Vector3.one;
            break;
        }

        if (relatively)
        {
            p_arg = new Vector3(lastScale.x * p_arg.x,
                                lastScale.y * p_arg.y,
                                lastScale.z * p_arg.z);
        }
        if (lastScale.Equals(p_arg))
        {
            return(false);
        }
        else
        {
            switch (transType)
            {
            case E_ObjCmdTransType.Local:
                gameObject.transform.localScale = p_arg;
                break;

            case E_ObjCmdTransType.Global:
                GameObjectExtend.SetLossyScale(gameObject.transform, p_arg);
                break;
            }
            return(true);
        }
    }