Ejemplo n.º 1
0
    protected GoTween StartRandomAnim(FSprite sprite)
    {
        GoTweenConfig config=new GoTweenConfig();

        int r=RXRandom.Int(8);
        if (r==0) {
            config.shakeFloatProp("x",RXRandom.Range(1f,10f)).shakeFloatProp("y",RXRandom.Range(1f,10f));
        } else if (r==1) {
            config.oscillateFloatProp("x",RXRandom.Range(1f,10f),RXRandom.Range(0.1f,3f)).oscillateFloatProp("y",RXRandom.Range(1f,10f),RXRandom.Range(0.1f,3f));
        } else if (r==2) {
            config.shakeFloatProp("rotation",RXRandom.Range(1f,20f));
        } else if (r==3) {
            config.oscillateFloatProp("rotation",RXRandom.Range(1f,20f),RXRandom.Range(0.1f,3f));
        } else if (r==4) {
            config.shakeFloatProp("scale",RXRandom.Range(0.05f,0.1f));
        } else if (r==5) {
            config.oscillateFloatProp("scale",RXRandom.Range(0.05f,0.1f),RXRandom.Range(0.1f,3f));
        } else if (r==6) {
            config.shakeColorProp("color",RandomUtils.RandomColor());
        } else if (r==7) {
            config.oscillateColorProp("color",RandomUtils.RandomColor(),RXRandom.Range(0.1f,3f));
        }

        config.easeType=RandomUtils.RandomEnum<GoEaseType>();
        while(config.easeType==GoEaseType.Punch) {
            config.easeType=RandomUtils.RandomEnum<GoEaseType>();
        }
        //config.easeType=GoEaseType.ElasticInOut;

        return Go.to (sprite,1f,config);
    }