Esempio n. 1
0
    private string GetLandEventForPosition()
    {
        if (this.IsOnSnow())
        {
            this.isSnow = true;
            return(this.landSnow);
        }
        if (this.surfaceDetector.Surface != UnderfootSurfaceDetector.SurfaceType.None)
        {
            return(this.landDefault);
        }
        if (LocalPlayer.FpCharacter.IsInWater())
        {
            return(this.landWater);
        }
        int prominantTextureIndex = TerrainHelper.GetProminantTextureIndex(base.transform.position);

        if (prominantTextureIndex == 1)
        {
            return(this.landMud);
        }
        if (prominantTextureIndex != 4)
        {
            return(this.landDefault);
        }
        return(this.landSand);
    }
Esempio n. 2
0
    private void spawnDigParticle(Vector3 pos)
    {
        if (CoopPeerStarter.DedicatedHost)
        {
            return;
        }
        Vector3 pos2 = pos;

        pos2.y = Terrain.activeTerrain.SampleHeight(pos) + Terrain.activeTerrain.transform.position.y;
        if (this.IsOnSnow())
        {
            PoolManager.Pools["Particles"].Spawn(LocalPlayer.ScriptSetup.events.snowFootParticle.transform, pos2, Quaternion.identity);
            return;
        }
        int prominantTextureIndex = TerrainHelper.GetProminantTextureIndex(base.transform.position);

        if (prominantTextureIndex == 6 || prominantTextureIndex == 1)
        {
            PoolManager.Pools["Particles"].Spawn(LocalPlayer.ScriptSetup.events.leafFootParticle.transform, pos2, Quaternion.identity);
        }
        else if (prominantTextureIndex == 3 || prominantTextureIndex == 0)
        {
            PoolManager.Pools["Particles"].Spawn(LocalPlayer.ScriptSetup.events.dustFootParticle.transform, pos2, Quaternion.identity);
        }
        else if (prominantTextureIndex == 4)
        {
            PoolManager.Pools["Particles"].Spawn(LocalPlayer.ScriptSetup.events.sandFootParticle.transform, pos2, Quaternion.identity);
        }
    }
Esempio n. 3
0
    public string GetFootstepForPosition()
    {
        this.isSnow = false;
        switch (this.surfaceDetector.Surface)
        {
        case UnderfootSurfaceDetector.SurfaceType.None:
            if (this.IsOnSnow())
            {
                this.isSnow = true;
                return(this.footstepSnow);
            }
            switch (TerrainHelper.GetProminantTextureIndex(base.transform.position))
            {
            case 0:
                return(this.footstepDefault);

            case 1:
                return(this.footstepMud);

            case 2:
            case 3:
            case 5:
            case 7:
                return(this.footstepRock);

            case 4:
                return(this.footstepSand);

            case 6:
                return(this.footstepLeaves);

            default:
                return(this.footstepDefault);
            }
            break;

        case UnderfootSurfaceDetector.SurfaceType.Wood:
            return(this.footstepWood);

        case UnderfootSurfaceDetector.SurfaceType.Rock:
            return(this.footstepRock);

        case UnderfootSurfaceDetector.SurfaceType.Carpet:
            return(this.footstepCarpet);

        case UnderfootSurfaceDetector.SurfaceType.Dirt:
            return(this.footstepDefault);

        case UnderfootSurfaceDetector.SurfaceType.Metal:
            return(this.footstepMetal);

        default:
            return(this.footstepDefault);
        }
    }
Esempio n. 4
0
 public static int GetProminantTextureIndex(Vector3 worldPosition)
 {
     return(TerrainHelper.GetProminantTextureIndex(Terrain.activeTerrain, worldPosition));
 }