public void BloodSplat(Vector3 pos, BloodSplatSize splatSize) { GameObject b = PoolManager.Instance.PoolNetworkInstantiate(bloodTile, pos, Quaternion.identity, MatrixManager.AtPoint(Vector3Int.RoundToInt(pos)).GameObject.transform); BloodSplat bSplat = b.GetComponent <BloodSplat>(); //choose a random blood sprite int spriteNum = 0; switch (splatSize) { case BloodSplatSize.small: spriteNum = Random.Range(137, 139); break; case BloodSplatSize.medium: spriteNum = Random.Range(116, 120); break; case BloodSplatSize.large: spriteNum = Random.Range(51, 56); break; } bSplat.bloodSprite = spriteNum; }
public void BloodSplat(Vector3 pos, BloodSplatSize splatSize) { //blood splat should be relative to the matrix it appears in, but parented to Objects just like all // the other objects in the matrix GameObject b = PoolManager.Instance.PoolNetworkInstantiate(bloodTile, pos, Quaternion.identity, MatrixManager.AtPoint(Vector3Int.RoundToInt(pos)).Objects); BloodSplat bSplat = b.GetComponent <BloodSplat>(); //choose a random blood sprite int spriteNum = 0; switch (splatSize) { case BloodSplatSize.small: spriteNum = Random.Range(137, 139); break; case BloodSplatSize.medium: spriteNum = Random.Range(116, 120); break; case BloodSplatSize.large: spriteNum = Random.Range(51, 56); break; } bSplat.bloodSprite = spriteNum; }
void SpawnRedBlood(Vector3 worldPos, BloodSplatSize splatSize) { GameObject chosenTile = null; switch (splatSize) { case BloodSplatSize.small: chosenTile = smallBloodTile; break; case BloodSplatSize.medium: chosenTile = mediumBloodTile; break; case BloodSplatSize.large: chosenTile = largeBloodTile; break; case BloodSplatSize.Random: int rand = Random.Range(0, 3); SpawnRedBlood(worldPos, (BloodSplatSize)rand); return; } if (chosenTile != null) { PoolManager.PoolNetworkInstantiate(chosenTile, worldPos, MatrixManager.AtPoint(Vector3Int.RoundToInt(worldPos), true).Objects); } }
public void BloodSplat(Vector3 worldPos, BloodSplatSize splatSize) { GameObject chosenTile = null; switch (splatSize) { case BloodSplatSize.small: chosenTile = smallBloodTile; break; case BloodSplatSize.medium: chosenTile = mediumBloodTile; break; case BloodSplatSize.large: chosenTile = largeBloodTile; break; } if (chosenTile != null) { PoolManager.PoolNetworkInstantiate(chosenTile, worldPos, MatrixManager.AtPoint(Vector3Int.RoundToInt(worldPos), true).Objects); } }
public static void BloodSplat(Vector3 worldPos, BloodSplatSize splatSize, BloodSplatType bloodColorType) { EnsureInit(); GameObject chosenTile = null; switch (bloodColorType) { case BloodSplatType.red: switch (splatSize) { case BloodSplatSize.small: chosenTile = smallBloodTile; break; case BloodSplatSize.medium: chosenTile = mediumBloodTile; break; case BloodSplatSize.large: chosenTile = largeBloodTile; break; case BloodSplatSize.Random: int rand = Random.Range(0, 3); BloodSplat(worldPos, (BloodSplatSize)rand, bloodColorType); return; } break; case BloodSplatType.green: switch (splatSize) { case BloodSplatSize.small: chosenTile = smallXenoBloodTile; break; case BloodSplatSize.medium: chosenTile = medXenoBloodTile; break; case BloodSplatSize.large: chosenTile = largeXenoBloodTile; break; case BloodSplatSize.Random: int rand = Random.Range(0, 3); BloodSplat(worldPos, (BloodSplatSize)rand, bloodColorType); return; } break; } if (chosenTile != null) { Spawn.ServerPrefab(chosenTile, worldPos, MatrixManager.AtPoint(Vector3Int.RoundToInt(worldPos), true).Objects); } }
public void BloodSplat(Vector3 pos, BloodSplatSize splatSize) { GameObject b = GameObject.Instantiate(bloodSplatPrefab, pos, Quaternion.identity); NetworkServer.Spawn(b); BloodSplat bSplat = b.GetComponent <BloodSplat>(); bSplat.SplatBlood(splatSize); }
//TODO Clean up: this is a duplicate of the same method on WeaponNetworkActions void BloodSplat(Vector3 pos, BloodSplatSize splatSize) { GameObject b = GameObject.Instantiate(Resources.Load("BloodSplat") as GameObject, pos, Quaternion.identity); NetworkServer.Spawn(b); BloodSplat bSplat = b.GetComponent <BloodSplat>(); bSplat.SplatBlood(splatSize); }
public void BloodSplat(Vector3 worldPos, BloodSplatSize splatSize, BloodSplatType bloodColorType) { switch (bloodColorType) { case BloodSplatType.red: SpawnRedBlood(worldPos, splatSize); break; case BloodSplatType.green: SpawnXenoBlood(worldPos, splatSize); break; } }
public void SplatBlood(BloodSplatSize bloodSize) { int spriteNum = 0; switch (bloodSize) { case BloodSplatSize.small: spriteNum = Random.Range(137, 139); break; case BloodSplatSize.medium: spriteNum = Random.Range(116, 120); break; case BloodSplatSize.large: spriteNum = Random.Range(105, 108); break; } RpcSetSprite(spriteNum); }
public static void BloodSplat(Vector3 worldPos, ReagentMix bloodReagents = default, BloodSplatSize splatSize = default, BloodSplatType bloodColorType = default) { EnsureInit(); GameObject chosenTile; string sizeDesc; if (bloodReagents.Total < SmallBleedThreshold) { chosenTile = smallBloodTile; sizeDesc = "drop"; } else if (bloodReagents.Total > SmallBleedThreshold && bloodReagents.Total < MedBleedThreshold) { chosenTile = mediumBloodTile; sizeDesc = "splat"; } else { chosenTile = largeBloodTile; sizeDesc = "pool"; } var bloodTileInst = Spawn.ServerPrefab(chosenTile, worldPos, MatrixManager.AtPoint(worldPos.CutToInt(), true).Objects, Quaternion.identity); if (bloodTileInst.Successful) { var colorDesc = TextUtils.ColorToString(bloodReagents.MixColor); bloodTileInst.GameObject.name = $"{colorDesc} blood {sizeDesc}"; var bloodTileGO = bloodTileInst.GameObject; var tileReagents = bloodTileGO.GetComponent <ReagentContainer>(); if (bloodTileGO) { var decal = bloodTileGO.GetComponent <FloorDecal>(); if (decal) { decal.color = bloodReagents.MixColor; tileReagents.Add(bloodReagents); } } } }