// Use this for initialization
    void Start()
    {
        Debug.Log("Arrow_Movement.Start()");
        gen          = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Step_Generator>();
        scoreHandler = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Score_Handler>();

        switch (GetComponent <SpriteRenderer>().sprite.name)
        {
        case "arrowsheet_down":
            dir = direction.down;
            break;

        case "arrowsheet_left":
            dir = direction.left;
            break;

        case "arrowsheet_right":
            dir = direction.right;
            break;

        case "arrowsheet_up":
            dir = direction.up;
            break;
        }
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        gen                 = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Step_Generator>();
        scoreHandler        = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Score_Handler>();
        heartbeatController = GameObject.FindGameObjectWithTag("Player").GetComponent <Heartbeat_Controller>();

        switch (GetComponent <SpriteRenderer>().sprite.name)
        {
        case "arrowsheet_a":
            dir = direction.a;
            break;

        case "arrowsheet_b":
            dir = direction.b;
            break;

        case "arrowsheet_spc":
            dir = direction.spc;
            break;

        case "arrowsheet_c":
            dir = direction.c;
            break;

        case "arrowsheet_d":
            dir = direction.d;
            break;
        }
    }