Exemplo n.º 1
0
    void Start()
    {
        myInputComponent     = GetComponent(typeof(IGetPlayerInput)) as IGetPlayerInput;
        rigidbody            = GetComponent <Rigidbody2D>();
        myInput              = new PlayerInput();
        ball                 = GameObject.FindGameObjectWithTag("Ball");
        ballCol              = ball.GetComponent <Collider2D>();
        ballRigidbody        = ball.GetComponent <Rigidbody2D>();
        aimLine              = new VectorLine("aimLine", new List <Vector3>(3), aimTexture, aimWidth, LineType.Continuous);
        aimLine.textureScale = aimTextureScale;
        gravityParticles     = GetComponent <ParticleSystem>();
        gravityParticles.Stop();
        currentShots = maxShots;

        foreach (CircleCollider2D col in GetComponents <CircleCollider2D>())
        {
            if (col.isTrigger)
            {
                gravityFieldTrigger = col;
                break;
            }
        }
    }
    void Start()
    {
        myInputComponent = GetComponent(typeof(IGetPlayerInput)) as IGetPlayerInput;
        rigidbody = GetComponent<Rigidbody2D>();
        myInput = new PlayerInput();
        ball = GameObject.FindGameObjectWithTag("Ball");
        ballCol = ball.GetComponent<Collider2D>();
        ballRigidbody = ball.GetComponent<Rigidbody2D>();
        aimLine = new VectorLine("aimLine", new List<Vector3>(3), aimTexture, aimWidth, LineType.Continuous);
        aimLine.textureScale = aimTextureScale;
        gravityParticles = GetComponent<ParticleSystem>();
        gravityParticles.Stop();
        currentShots = maxShots;

        foreach(CircleCollider2D col in GetComponents<CircleCollider2D>())
        {
            if (col.isTrigger)
            {
                gravityFieldTrigger = col;
                break;
            }
        }
    }