Exemplo n.º 1
0
 public void Init(bool gunBall, BallType ballType, BallStyle style, BallColor ballColor, bool checkJoin = false)
 {
     if (!ballCollider)
     {
         ballCollider = GetComponent <CircleCollider2D>();
     }
     if (!BallBody2D)
     {
         BallBody2D = GetComponent <Rigidbody2D>();
     }
     this.style         = style;
     reactAfterJoint    = false;
     killAfterJoint     = false;
     this.ballColor     = BallColor.None;
     ballRenderer.color = Color.white;
     Colored            = true;
     Destroying         = false;
     waveNum            = 0;
     Targeted           = false;
     ClearJoints();
     BallBody2D.isKinematic = this.gunBall = gunBall;
     BallType             = ballType;
     BallColor            = ballColor;
     WasJoin              = false;
     ballCollider.enabled = true;
     if (checkJoin)
     {
         JoinNearBalls(ballCollider.radius);
     }
 }
Exemplo n.º 2
0
        public GameObject Create(Vector3 position, Color32 color, BallStyle ballStyle)
        {
            var ball = GameObject.CreatePrimitive(PrimitiveType.Sphere);

            ball.transform.localScale = Vector3.one * ballStyle.UniformScale;
            ball.transform.position   = position;
            ballStyle.Material.color  = color;
            ball.GetComponent <Renderer>().material = ballStyle.Material;

            return(ball);
        }
Exemplo n.º 3
0
        private void Refresh(BallStyle style)
        {
            switch (style)
            {
            case BallStyle.Normal:
                Normal.SetActive(true);
                ColorFigured.SetActive(false);
                break;

            case BallStyle.ColorFigured:
                Normal.SetActive(false);
                ColorFigured.SetActive(true);
                break;
            }
        }
Exemplo n.º 4
0
 private void GameData_BallStyleChanged(BallStyle ballStyle)
 {
 }
Exemplo n.º 5
0
 private void GameData_BallStyleChanged(BallStyle style)
 {
     Refresh(style);
 }