示例#1
0
    void Start()
    {
        gmc       = GetComponent <GMComponent>();
        obstacles = GetComponent <NewCollider2D>();

        gmc.ImageSpeed  = 0.0f;
        gmc._applySpeed = false;
    }
示例#2
0
    void Start()
    {
        // Used for detecting collision with obstacles, so the particles get 'stuck' on the objects
        obstaclesController = GetComponent <NewCollider2D>();

        // Random speed
        velocity.x = Random.Range(-6.0f, 6.0f);
        velocity.y = Random.Range(-6.0f, 6.0f);
    }
示例#3
0
    void Start()
    {
        camera              = FindObjectOfType <Camera>();
        animator            = GetComponent <Animator>();
        obstaclesController = GetComponent <NewCollider2D>();

        GetComponent <SpriteRenderer>().flipX = faceDir == -1;

        statsDisplay          = Instantiate(statsDisplay);
        statsDisplayComponent = statsDisplay.GetComponent <StatsDisplay>();

        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(GM.gravity) * 7.8f);
    }
    void Start()
    {
        NewCollider2D[] newColliders = GetComponents <NewCollider2D>();
        dangersController        = newColliders[0];
        savesController          = newColliders[1];
        warpsController          = newColliders[2];
        jumpRefreshersController = newColliders[3];
        triggersController       = newColliders[4];
        player = transform.parent.GetComponent <Player>();

        if (GameObject.FindGameObjectWithTag("LightsOutController") != null)
        {
            lightsOut = GameObject.FindGameObjectWithTag("LightsOutController").GetComponent <LightsOutController>();
        }
    }
示例#5
0
    void Start()
    {
        // At the start ensure we don't have more than max amount of bullets on the screen
        if (FindObjectsOfType <Bullet>().Length > maxBullets)
        {
            // Destroy instantly to prevent calling update
            Destroy(gameObject);
            return;
        }

        NewCollider2D[] newColliders = GetComponents <NewCollider2D>();
        savesController     = newColliders[0];
        obstaclesController = newColliders[1];

        GameManager.Instance.PlaySound("Shoot");
    }