private RuntimeAnimatorController TypeToAnimator(RiverType type)
    {
        switch (type)
        {
        case RiverType.HORIZONTAL:
            return(horizontalAnimator);

        case RiverType.VERTICAL:
            return(verticalAnimator);

        case RiverType.TJUNCTION:
            return(tJunctionAnimator);

        case RiverType.CURVE:
            return(curveAnimator);

        default:
            throw new ArgumentOutOfRangeException(nameof(type), type, null);
        }
    }
    private Sprite TypeToSprite(RiverType type)
    {
        switch (type)
        {
        case RiverType.HORIZONTAL:
            return(horizontalSprite);

        case RiverType.VERTICAL:
            return(verticalSprite);

        case RiverType.TJUNCTION:
            return(tJunctionSprite);

        case RiverType.CURVE:
            return(curveSprite);

        default:
            throw new ArgumentOutOfRangeException(nameof(type), type, null);
        }
    }
Exemple #3
0
        public void Initialise(RiverInfo info)
        {
            for (int i = 0; i < 12; i++)
            {
                if (myAtlasBillboard[i] == null)
                {
                    myAtlasBillboard[i] = new Billboard("river");
                }

                myAtlasBillboard[i].StopRender();

                myAtlasBillboard[i].SetAtlas(Globals.g_world.GetAtlas((int)AtlasType.kAtlas_GrassTiles));

                myAtlasBillboard[i].myObject.GetComponent <Renderer>().sharedMaterial = Globals.g_world.GetAtlas((int)AtlasType.kAtlas_GrassTiles).myMaterialTransparent;

                //int tileSubtexture = ((Globals.g_world.game).lBuilder).GetTileMapTileP1P2((int) AtlasType.kAtlas_GrassTiles, bridgeX + x, bridgeY + y);

                myAtlasBillboard[i].SetDetailsFromAtlas(Globals.g_world.GetAtlas((int)AtlasType.kAtlas_GrassTiles), 0);

                //
//								myAtlasBillboard[i].myObject.GetComponent<MeshRenderer>().sharedMaterial = Globals.g_main.grassSpriteAtlas;
//								Globals.g_main.grassSpriteAtlas.SetTexture("_MainTex",);
            }

            isBeingDrawn = false;

            riverType = info.riverType;
            if (false)
            {
                yCliffStart  = (float)info.yPos - 32 + 94 - 15 - 40.0f;
                yCliffLength = (float)(340);
                raiseLength  = 120.0f;
            }
            else
            {
                yCliffStart  = (float)info.yPos - 32 + 60 - 15 - 40.0f;
                yCliffLength = (float)(400);
                raiseLength  = 80.0f;
            }

            xFlowerPosition = (float)info.xPosBridge;
            xWidth          = (float)info.widthBridge;
            CGPoint stemPosition = Utilities.CGPointMake(xFlowerPosition, yCliffStart + yCliffLength - 65.0f);

            if (xWidth == 128.0f)
            {
                if (xFlowerPosition == 320.0f)
                {
                    stemPosition.x -= 8.0f;
                }
                else if (xFlowerPosition == 64.0f)
                {
                    stemPosition.x += 8.0f;
                }
            }

            if (info.widthBridge == 64)
            {
                noGoStem.InitialiseP1(stemPosition, 30);
            }
            else
            {
                noGoStem.InitialiseP1(stemPosition, 65);
            }

            noGoStem.SetGroundLevel(-Game.kClifffDepth);
            noGoStem.SetType(NoGoType.e_Bridge);
        }
Exemple #4
0
        }                                                         ///@property(readwrite,assign) float raiseLength;

        public void SetRiverType(RiverType inThing)
        {
            riverType = inThing;
        }                                                         ///@property(readwrite,assign) RiverType riverType;
 public RiverPackage(WorldLocation worldLocation, RiverType type)
 {
     WorldLocation = worldLocation;
     Type          = type;
 }