Example #1
0
                    public void Duplicate(PartsColor original)
                    {
                        Bound     = original.Bound;
                        Operation = original.Operation;
#if ATTRIBUTE_DUPLICATE_DEEP
                        /* MEMO: Deep copy */
                        int countVertex = original.VertexColor.Length;
                        if ((null == VertexColor) || (VertexColor.Length != countVertex))
                        {
                            VertexColor = new Color[countVertex];
                        }
                        for (int i = 0; i < countVertex; i++)
                        {
                            VertexColor[i] = original.VertexColor[i];
                        }

                        if ((null == RateAlpha) || (RateAlpha.Length != countVertex))
                        {
                            RateAlpha = new float[countVertex];
                        }
                        for (int i = 0; i < countVertex; i++)
                        {
                            RateAlpha[i] = original.RateAlpha[i];
                        }
#else
                        /* MEMO: Shallow copy */
                        VertexColor = original.VertexColor;
                        RateAlpha   = original.RateAlpha;
#endif
                    }
Example #2
0
                    public override bool Equals(System.Object target)
                    {
                        if ((null == target) || (GetType() != target.GetType()))
                        {
                            return(false);
                        }

                        PartsColor targetData = (PartsColor)target;

                        if ((Bound != targetData.Bound) || (Operation != targetData.Operation))
                        {
                            return(false);
                        }

                        int countVertex = VertexColor.Length;

                        if (VertexColor.Length != targetData.VertexColor.Length)
                        {
                            return(false);
                        }
                        for (int i = 0; i < countVertex; i++)
                        {
                            if (VertexColor[i] != targetData.VertexColor[i])
                            {
                                return(false);
                            }
                        }

                        countVertex = RateAlpha.Length;
                        if (RateAlpha.Length != targetData.RateAlpha.Length)
                        {
                            return(false);
                        }
                        for (int i = 0; i < countVertex; i++)
                        {
                            if (RateAlpha[i] != targetData.RateAlpha[i])
                            {
                                return(false);
                            }
                        }
                        return(true);
                    }
 void Start()
 {
     DontDestroyOnLoad(this);
     flag = false;
     _moreu1 = moreu1.GetComponent<PartsColor>();
     _moreu2 = moreu2.GetComponent<PartsColor>();
     _shiku = shiku.GetComponent<PartsColor>();
     _aiushi = shiku.GetComponent<PartsColor>();
 }