示例#1
0
    public override void OnExecute()
    {
        base.OnExecute();
        GameObject item = layer.ShowLine(fcell, tcell);

        Image image = item.GetComponentInChildren <Image>();

        float len = VectorLen(PosUtil.GetFightCellPos(fcell.posX, fcell.posY), PosUtil.GetFightCellPos(tcell.posX, tcell.posY));

        image.rectTransform.sizeDelta  = new Vector2(len, 20);
        image.rectTransform.localScale = new Vector3(0, 1, 1);
        if (forceId > 0)
        {
            image.color = ColorUtil.GetColor(ColorUtil.GetCellColorValue(forceId));
        }
        else
        {
            image.color = ColorUtil.GetColor(ColorUtil.GetCellColorValue(fcell.config.id));
        }

        LeanTween.scaleX(image.gameObject, 1, len / 1500.00f).onComplete = CompleteHander;
    }