You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlumberUltimateAds/Assets/Scripts/Cell.cs

934 lines
20 KiB
C#

Squashed commit of the following: commit 761fe0f0e39341baeea362d1a24b85307c6533bf Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 17 17:30:04 2024 +0500 Fixed some spash issues commit a29c5d792ee1e70828ca21d11b1d0e8b57194d3b Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 17 16:57:44 2024 +0500 Fixed Splash issue commit 4000ab25110d0593dfe5ad5eea81a4109a744464 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 17 16:00:08 2024 +0500 fixed spalsh issue commit df377a68259ee183783ce1d898258a26e9f7e6de Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 17 00:59:51 2024 +0500 Reapply "Fixed Splash Animation" This reverts commit b13733598e066c087cc1835f0e566d9fc6e4ebb3. commit b13733598e066c087cc1835f0e566d9fc6e4ebb3 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 17 00:39:51 2024 +0500 Revert "Fixed Splash Animation" This reverts commit 7ca6548075765db1bc2f62015ffec7fecb6235de. commit 7ca6548075765db1bc2f62015ffec7fecb6235de Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Wed Oct 16 17:19:40 2024 +0500 Fixed Splash Animation commit ec93b630739611fe012cd30c081421d4f63f3395 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Wed Oct 16 16:52:15 2024 +0500 Added New Pipes commit 47925d7b4d767d72f41a8e24b2728645a6444771 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Tue Oct 15 18:08:10 2024 +0500 Some indentation commit 0c342ac10c38154817b2e11f05821b0f1a1ea674 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Tue Oct 15 18:07:14 2024 +0500 Increased Level Cell Size commit f3a7e3ed5a1ae97a6aae36cd9e1c87f206a1488c Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Tue Oct 15 18:02:58 2024 +0500 Revert "Increased Cell size" This reverts commit 6e4c1672ba8e63276cfe45afed9af56abb7668de. commit 6e4c1672ba8e63276cfe45afed9af56abb7668de Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Tue Oct 15 17:48:28 2024 +0500 Increased Cell size commit dce666657f57307688c7633084330aec07052f78 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Tue Oct 15 17:36:13 2024 +0500 Added Ranked Up Screen commit d4883314781598c9a3444930ac0a956b1b088890 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Tue Oct 15 14:13:54 2024 +0500 Added new Level Complete Screen commit 1ef6d7cf34773c89b12723f99e26b6aa6043745a Author: TG9six <totalgamer.tg.x@gmail.com> Date: Mon Oct 14 12:04:04 2024 +0400 UI improved Level selection change anchoring improved commit ea8f9899e856e021978159125a8e782bd0cf3a53 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Fri Oct 11 21:05:40 2024 +0500 All UI Done commit d656fb09a601bc57f1e6d004b83256ce26e59d97 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Fri Oct 11 19:15:22 2024 +0500 Added Level Screen commit f131e38a6b7ea830ae6816df16d148bbf3847dcd Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Fri Oct 11 17:13:26 2024 +0500 Gameplay UI Done commit a695895c90522a7208abfa9edc07040021362799 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Fri Oct 11 16:36:09 2024 +0500 Added all gameplay UI commit ab259bf005c7dc1bf01cc334da9b5dd701818496 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Fri Oct 11 11:21:47 2024 +0500 Added Level Type Selection Screen commit 8cebd78cfeec4fea53a38687d8c244c8ff08f15b Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 10 21:33:27 2024 +0500 Added RateUs commit 901e44afafb7b0bca1209df744d9a0be1012cd0b Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 10 20:56:50 2024 +0500 Before addiung unity figma bridge commit bdc01bcb186e1714d5b7efa061418e979b926312 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Thu Oct 10 19:36:39 2024 +0500 Added Settings menu commit 85b53482054a0f4831dc62ca805dbc8a96e474e5 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Wed Oct 9 19:13:39 2024 +0500 Added Main Menu Screen commit a80c82c82f91563ea3a06a5d7cb4219dc9520b14 Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Wed Oct 9 17:26:31 2024 +0500 Added new main menu UI commit 833a599da1496f33d46bd2f32457ad2b16f6bd9d Author: Hazim Bin Ijaz <hazimijaz_gamedev@rizzestudios.com> Date: Wed Oct 9 13:22:52 2024 +0500 Added MainMenu Animation
5 months ago
/*
http://www.cgsoso.com/forum-211-1.html
CG Unity3d Unity3d VIP
CGSOSO CG
daily assets update for try.
U should buy the asset from home store if u use it in your project!
*/
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Cell : MonoBehaviour
{
public Vector2Int pos;
public PipeColor defaultColor;
public int rightRotationValue;
[Header("PipeDetail")]
public RectTransform pipeParent;
public CellType pipeCellType;
public List<Pipe> pipes;
public List<Sprite> pipeSprites;
public int correctRotateDelta = 4;
[HideInInspector]
public bool redundant;
private bool _isHint;
public int _rotationValue;
private object pipe;
public CellKind cellKind;
public bool IsHint
{
get
{
return _isHint;
}
set
{
if (value)
{
RotationValue = rightRotationValue;
ApplyRotationOnImage(0.05f);
GetComponent<Image>().color = ColorManager.intance.hintCellBGColor;
}
else
{
GetComponent<Image>().color = ColorManager.intance.normalCellBGColor;
}
_isHint = value;
}
}
public int RotationValue
{
get
{
return _rotationValue;
}
set
{
if (!IsHint)
{
int num = (value < 4) ? value : 0;
num = (_rotationValue = ((num >= 0) ? num : 3));
pipes.ForEach(delegate (Pipe obj)
{
obj.SetPipeRotation(_rotationValue);
SetCellFlowSide(cellKind);
});
}
}
}
public Cell RightCell
{
get
{
Vector2Int v = pos + Vector2Int.right;
if (!IsValidIndex(v))
{
return null;
}
return GetCellFromVector(v);
}
}
public Cell LeftCell
{
get
{
Vector2Int v = pos + Vector2Int.left;
if (!IsValidIndex(v))
{
return null;
}
return GetCellFromVector(v);
}
}
public Cell TopCell
{
get
{
Vector2Int v = pos + Vector2Int.down;
if (!IsValidIndex(v))
{
return null;
}
return GetCellFromVector(v);
}
}
public Cell BottomCell
{
get
{
Vector2Int v = pos + Vector2Int.up;
if (!IsValidIndex(v))
{
return null;
}
return GetCellFromVector(v);
}
}
public void SetLevelData(LevelCellData lcd)
{
defaultColor = lcd.DefaultColor;
if (pipeCellType != 0)
{
GetComponent<Button>().onClick.AddListener(delegate
{
if (GamePlayManager.instance != null)
{
GamePlayManager.instance.OnButtonClick(this);
}
});
}
rightRotationValue = lcd.RightRotationValue;
RotationValue = lcd.CurrentRotationValue;
ApplyRotationOnImage();
UpdatePipeColor();
IsHint = false;
redundant = lcd.Redundant;
}
public void UpdatePipeColor()
{
if (pipeCellType == CellType.Start)
{
pipes.ForEach(delegate (Pipe p)
{
switch (defaultColor)
{
case PipeColor.None:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.None;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.None;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.None;
});
break;
case PipeColor.A:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Red;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Red;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Red;
});
break;
case PipeColor.B:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Blue;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Blue;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Blue;
});
break;
case PipeColor.C:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Yellow;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Yellow;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Yellow;
});
break;
case PipeColor.AB:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Purple;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Purple;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Purple;
});
break;
case PipeColor.AC:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Orange;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Orange;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Orange;
});
break;
case PipeColor.BC:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Green;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Green;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Green;
});
break;
case PipeColor.ABC:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Brown;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Brown;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Brown;
});
break;
default:
break;
}
});
}
if (pipeCellType == CellType.Middle)
{
pipes.ForEach(delegate (Pipe p)
{
p.pipeImage.sprite = pipeSprites[(int)ColorManager.MixPipeColor(p.fillColor)];
switch (ColorManager.MixPipeColor(p.fillColor))
{
case PipeColor.None:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.None;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.None;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.None;
});
break;
case PipeColor.A:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Red;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Red;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Red;
});
break;
case PipeColor.B:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Blue;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Blue;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Blue;
});
break;
case PipeColor.C:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Yellow;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Yellow;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Yellow;
});
break;
case PipeColor.AB:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Purple;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Purple;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Purple;
});
break;
case PipeColor.AC:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Orange;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Orange;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Orange;
});
break;
case PipeColor.BC:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Green;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Green;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Green;
});
break;
case PipeColor.ABC:
pipes.ForEach(delegate (Pipe obj)
{
obj.Img_1.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Brown;
obj.Img_2.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Brown;
obj.Img_3.transform.GetChild(0).GetComponent<Image>().color = ColorManager.intance.Brown;
});
break;
default:
break;
}
});
}
else
{
pipes.ForEach(delegate (Pipe p)
{
p.pipeImage.sprite = pipeSprites[(int)defaultColor];
});
}
}
public void ApplyRotationOnImage(float t = 0f)
{
LeanTween.rotateZ(pipeParent.gameObject, (float)_rotationValue * -90f, t);
}
private bool IsValidIndex(Vector2Int v)
{
if (v.x < 0 || v.y < 0 || v.x >= GameManager.currentLevel.column || v.y >= GameManager.currentLevel.row)
{
return false;
}
Cell cellFromVector = GetCellFromVector(v);
if (cellFromVector.pipeCellType == CellType.Blank)
{
return false;
}
return true;
}
private Cell GetCellFromVector(Vector2Int v)
{
int index = v.y * GameManager.currentLevel.column + v.x;
return GamePlayManager.instance.allCellList[index];
}
public bool HasSide(Side side)
{
foreach (Pipe pipe in pipes)
{
if (pipe.R && side == Side.R)
{
return true;
}
if (pipe.L && side == Side.L)
{
return true;
}
if (pipe.T && side == Side.T)
{
return true;
}
if (pipe.B && side == Side.B)
{
return true;
}
}
return false;
}
public bool HasAnyColor()
{
foreach (Pipe pipe in pipes)
{
if (pipe.fillColor.Count > 0)
{
return true;
}
}
return false;
}
public bool IsInRighRotation()
{
return (Mathf.Max(RotationValue, rightRotationValue) - Mathf.Min(RotationValue, rightRotationValue)) % correctRotateDelta == 0;
}
public void RemoveAllPipeColor()
{
pipes.ForEach(delegate (Pipe obj)
{
obj.RemoveAll();
});
// Reset Pipe Leaking
pipes.ForEach(delegate (Pipe obj)
{
obj.BottomLeak = false;
obj.LeftLeak = false;
obj.RightLeak = false;
obj.TopLeak = false;
if(obj.Img_1)
obj.Img_1.gameObject.SetActive(false);
if(obj.Img_2)
obj.Img_2.gameObject.SetActive(false);
if(obj.Img_3)
obj.Img_3.gameObject.SetActive(false);
});
}
public void FillColor(List<PipeColor> c, Cell source, Side sourceSide)
{
if (pipeCellType != CellType.Start)
{
foreach (Pipe pipe in pipes)
{
if ((pipe.L && sourceSide == Side.R) || (pipe.R && sourceSide == Side.L) || (pipe.T && sourceSide == Side.B) || (pipe.B && sourceSide == Side.T))
{
if (pipe.AddColor(c) == 0)
{
break;
}
if (pipe.L && LeftCell != null && LeftCell != source)
{
LeftCell.FillColor(c, this, Side.L);
}
if (pipe.L)
{
if (LeftCell != null)
{
foreach (Pipe leftCellPipe in LeftCell.pipes)
{
if (leftCellPipe.R)
{
pipe.LeftLeak = false;
if (pipe.leakL != null)
{
pipe.leakL.gameObject.SetActive(false);
}
break;
}
else
{
pipe.LeftLeak = true;
if (pipe.leakL != null)
{
pipe.leakL.gameObject.SetActive(true);
}
}
}
}
else
{
pipe.LeftLeak = true;
if (pipe.leakL != null)
{
pipe.leakL.gameObject.SetActive(true);
}
}
//if (LeftCell == null)
//{
// pipe.LeftLeak = true;
//}
//else if (LeftCell.pipes[0].R)
//{
// pipe.LeftLeak = false;
//}
//else
//{
// pipe.LeftLeak = true;
//}
}
if (pipe.R && RightCell != null && RightCell != source)
{
RightCell.FillColor(c, this, Side.R);
}
if (pipe.R)
{
if (RightCell != null)
{
foreach (Pipe rightCellPipe in RightCell.pipes)
{
if (rightCellPipe.L)
{
pipe.RightLeak = false;
if (pipe.leakR != null)
{
pipe.leakR.gameObject.SetActive(false);
}
break;
}
else
{
pipe.RightLeak = true;
if (pipe.leakR != null)
{
pipe.leakR.gameObject.SetActive(true);
}
}
}
}
else
{
pipe.RightLeak = true;
if (pipe.leakR != null)
{
pipe.leakR.gameObject.SetActive(true);
}
}
}
if (pipe.T && TopCell != null && TopCell != source)
{
TopCell.FillColor(c, this, Side.T);
}
if (pipe.T)
{
if (TopCell != null)
{
foreach (Pipe topCellPipe in TopCell.pipes)
{
if (topCellPipe.B)
{
pipe.TopLeak = false;
if (pipe.leakT != null)
{
pipe.leakT.gameObject.SetActive(false);
}
break;
}
else
{
pipe.TopLeak = true;
if (pipe.leakT != null)
{
pipe.leakT.gameObject.SetActive(true);
}
}
}
}
else
{
pipe.TopLeak = true;
if (pipe.leakT != null)
{
pipe.leakT.gameObject.SetActive(true);
}
}
}
if (pipe.B && BottomCell != null && BottomCell != source)
{
BottomCell.FillColor(c, this, Side.B);
}
if (pipe.B)
{
if (BottomCell != null)
{
foreach (Pipe bottomCellPipe in BottomCell.pipes)
{
if (bottomCellPipe.T)
{
pipe.BottomLeak = false;
if (pipe.leakB != null)
{
pipe.leakB.gameObject.SetActive(false);
}
break;
}
else
{
pipe.BottomLeak = true;
if (pipe.leakB != null)
{
pipe.leakB.gameObject.SetActive(true);
}
}
}
}
else
{
pipe.BottomLeak = true;
if (pipe.leakB != null)
{
pipe.leakB.gameObject.SetActive(true);
}
}
}
}
}
}
}
public void SetCellFlowSide(CellKind cellKind)
{
switch (cellKind)
{
case CellKind.Single:
if (_rotationValue ==0)
{
pipes[0].leakB = pipes[0].Img_1.gameObject;
}
else if (_rotationValue == 1)
{
pipes[0].leakL = pipes[0].Img_1.gameObject;
}
else if (_rotationValue == 2)
{
pipes[0].leakT = pipes[0].Img_1.gameObject;
}
else if (_rotationValue == 3)
{
pipes[0].leakR = pipes[0].Img_1.gameObject;
}
break;
case CellKind.StraightTwoFace:
if (_rotationValue == 0)
{
pipes[0].leakB = pipes[0].Img_1.gameObject;
pipes[0].leakT = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 1)
{
pipes[0].leakL = pipes[0].Img_1.gameObject;
pipes[0].leakR = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[0].leakT = pipes[0].Img_1.gameObject;
pipes[0].leakB = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 3)
{
pipes[0].leakR = pipes[0].Img_1.gameObject;
pipes[0].leakL = pipes[0].Img_2.gameObject;
}
break;
case CellKind.CurvedTwoFace:
if (_rotationValue == 0)
{
pipes[0].leakB = pipes[0].Img_1.gameObject;
pipes[0].leakR = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 1)
{
pipes[0].leakL = pipes[0].Img_1.gameObject;
pipes[0].leakB = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[0].leakT = pipes[0].Img_1.gameObject;
pipes[0].leakL = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 3)
{
pipes[0].leakR = pipes[0].Img_1.gameObject;
pipes[0].leakT = pipes[0].Img_2.gameObject;
}
break;
case CellKind.ThreeFace:
if (_rotationValue == 0)
{
pipes[0].leakB = pipes[0].Img_1.gameObject;
pipes[0].leakL = pipes[0].Img_2.gameObject;
pipes[0].leakR = pipes[0].Img_3.gameObject;
}
else if (_rotationValue == 1)
{
pipes[0].leakL = pipes[0].Img_1.gameObject;
pipes[0].leakB = pipes[0].Img_3.gameObject;
pipes[0].leakT = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[0].leakT = pipes[0].Img_1.gameObject;
pipes[0].leakL = pipes[0].Img_3.gameObject;
pipes[0].leakR = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 3)
{
pipes[0].leakR = pipes[0].Img_1.gameObject;
pipes[0].leakB = pipes[0].Img_2.gameObject;
pipes[0].leakT = pipes[0].Img_3.gameObject;
}
break;
case CellKind.StraightDualTwoFace:
if (_rotationValue == 0)
{
pipes[0].leakB = pipes[0].Img_1.gameObject;
pipes[0].leakT = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 1)
{
pipes[0].leakL = pipes[0].Img_1.gameObject;
pipes[0].leakR = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[0].leakT = pipes[0].Img_1.gameObject;
pipes[0].leakB = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 3)
{
pipes[0].leakR = pipes[0].Img_1.gameObject;
pipes[0].leakL = pipes[0].Img_2.gameObject;
}
//////////////////////////////////////////////////////////
if (_rotationValue == 0)
{
pipes[1].leakL = pipes[1].Img_1.gameObject;
pipes[1].leakR = pipes[1].Img_2.gameObject;
}
else if (_rotationValue == 1)
{
pipes[1].leakT = pipes[1].Img_1.gameObject;
pipes[1].leakB = pipes[1].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[1].leakL = pipes[1].Img_2.gameObject;
pipes[1].leakR = pipes[1].Img_1.gameObject;
}
else if (_rotationValue == 3)
{
pipes[1].leakT = pipes[1].Img_2.gameObject;
pipes[1].leakB = pipes[1].Img_1.gameObject;
}
break;
case CellKind.CurvedDualTwoFace:
if (_rotationValue == 0)
{
pipes[0].leakR = pipes[0].Img_1.gameObject;
pipes[0].leakB = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 1)
{
pipes[0].leakB = pipes[0].Img_1.gameObject;
pipes[0].leakL = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[0].leakL = pipes[0].Img_1.gameObject;
pipes[0].leakT = pipes[0].Img_2.gameObject;
}
else if (_rotationValue == 3)
{
pipes[0].leakT = pipes[0].Img_1.gameObject;
pipes[0].leakR = pipes[0].Img_2.gameObject;
}
//////////////////////////////////////////////////
if (_rotationValue == 0)
{
pipes[1].leakT = pipes[1].Img_1.gameObject;
pipes[1].leakL = pipes[1].Img_2.gameObject;
}
else if (_rotationValue == 1)
{
pipes[1].leakR = pipes[1].Img_1.gameObject;
pipes[1].leakT = pipes[1].Img_2.gameObject;
}
else if (_rotationValue == 2)
{
pipes[1].leakB = pipes[1].Img_1.gameObject;
pipes[1].leakR = pipes[1].Img_2.gameObject;
}
else if (_rotationValue == 3)
{
pipes[1].leakL = pipes[1].Img_1.gameObject;
pipes[1].leakB = pipes[1].Img_2.gameObject;
}
break;
default:
break;
}
}
}