/// <summary>
    /// 设置前景对象的缩放
    /// <para>spObj 对象本体</para>
    /// <para>scaleX</para>
    /// <para>scaleY</para>
    /// </summary>
    /// <param name="luaState"></param>
    /// <returns></returns>
    public static int SetBgSpriteObjectScale(ILuaState luaState)
    {
        BgSpriteObject spObj  = luaState.ToUserData(-3) as BgSpriteObject;
        float          scaleX = (float)luaState.ToNumber(-2);
        float          scaleY = (float)luaState.ToNumber(-1);

        luaState.Pop(3);
        spObj.SetScale(scaleX, scaleY, 1);
        return(0);
    }
Exemple #2
0
 public override void Update(int curFrame)
 {
     if (curFrame % 30 == 0)
     {
         BgSpriteObject spObj = CreateBgSpriteObject("Common/MapleLeaf1");
         float          posX  = Random.Range(80, 150);
         float          posY  = Random.Range(200, 225);
         spObj.SetToPos(posX, posY);
         float scale = Random.Range(0.2f, 1);
         spObj.SetScale(new Vector3(scale, scale));
         spObj.SetVelocity(Random.Range(1f, 3f), Random.Range(-150, -30));
         spObj.SetSelfRotateAngle(new Vector3(0, 0, Random.Range(1f, 2f)));
         spObj.DoFade(Random.Range(90, 180), Random.Range(180, 300));
     }
     if (_isCameraMoving)
     {
         MoveCamera();
     }
     base.Update(curFrame);
 }