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/Pipe.cs

123 lines
1.6 KiB
C#

2 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;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
[Serializable]
public class Pipe
{
public Image Img_1;
public Image Img_2;
public Image Img_3;
public GameObject leakL;
public GameObject leakR;
public GameObject leakT;
public GameObject leakB;
public Image pipeImage;
public bool L;
public bool R;
public bool T;
public bool B;
public List<PipeColor> fillColor = new List<PipeColor>();
private int currentRotation;
public bool LeftLeak;
public bool RightLeak;
public bool TopLeak;
public bool BottomLeak;
public int AddColor(PipeColor c)
{
int num = 0;
if (c == PipeColor.None)
{
return 0;
}
if (!fillColor.Contains(c))
{
fillColor.Add(c);
num++;
}
return num;
}
public int AddColor(List<PipeColor> c)
{
int addedColor = 0;
c.ForEach(delegate(PipeColor obj)
{
addedColor += AddColor(obj);
});
return addedColor;
}
public void RemoveAll()
{
fillColor.Clear();
}
public void SetPipeRotation(int r)
{
while (currentRotation != r)
{
if (currentRotation < r)
{
bool r2 = R;
R = T;
T = L;
L = B;
B = r2;
currentRotation++;
}
else
{
bool r3 = R;
R = B;
B = L;
L = T;
T = r3;
currentRotation--;
}
}
}
}