public Shell(ShellColor color) { Color healthBarFillColor = Color.White; this.scale = new Vector2(0.50f, 0.50f); this.color = color; this.z = 0.98f; ShellManager.GetInstance().shells.AddLast(this); MouseManager.GetInstance().mouseMotionListeners += this.OnMouseMotion; MouseManager.GetInstance().mouseClickedListeners += this.OnMouseClick; }
public virtual void ChangeShellColor(int ColorNum) { ShellColor color = (ShellColor)ColorNum; switch (color) { case ShellColor.Brown: newColor = Brown_0; break; case ShellColor.Orange: newColor = Orange_1; break; case ShellColor.Gray: newColor = Gray_2; break; case ShellColor.White: newColor = White_3; break; case ShellColor.Red: newColor = Red_4; break; case ShellColor.Blue: newColor = Blue_5; break; case ShellColor.Black: newColor = Black_6; break; } newColor.a = cheke_bai.GetColor("_BaseColor").a;//保证在透明化时改变汽车颜色不会变回不透明的 oldColor = cheke_bai.GetColor("_BaseColor"); isChangeColor = true; }