コード例 #1
0
ファイル: ObjectSpawner.cs プロジェクト: ashrafuz/ColorBox
    void Awake()
    {
        screenWidth  = CameraProp.GetCameraWidth(Camera.main);
        screenHeight = CameraProp.GetCameraHeight(Camera.main);

        offsetX = 55f;
        offsetY = 55f;
        rangeX  = screenWidth / 2f - offsetX;
        startY  = screenHeight / 2f + offsetY;

        minTimeWait = 0.4f;
        maxTimeWait = 0.9f;
    }    //awake
コード例 #2
0
ファイル: TrackSpawner.cs プロジェクト: ashrafuz/ColorBox
    void Awake()
    {
        screenWidth  = CameraProp.GetCameraWidth(Camera.main);
        screenHeight = CameraProp.GetCameraHeight(Camera.main);

        rangeX = screenWidth / 2f;
        startY = transform.position.y;

        positionX1 = 0f;
        positionX2 = (rangeX / 2f);
        positionX3 = -positionX2;


        // generate objects
        // if it crosses screen height, deactivate it
    }    //awake
コード例 #3
0
    void Awake()
    {
        Time.timeScale       = 1f;
        isAlive              = true;
        direction            = 0;
        score                = 0;
        indicatorHeight      = 0.15f;
        playerBoxColorString = AllColors.GET_RANDOM_COLOR_STRING();

        indicatorObject = gameObject.transform.GetChild(0).gameObject;
        boundaryX       = CameraProp.GetCameraWidth(Camera.main) / 2 - 55f;

        //default
        indicatorObject.transform.localScale = new Vector3(1f, indicatorHeight, 1f);
        colorChooserTimer = 10;

        StopAllCoroutines();
        StopCoroutine("ChangePlayerColorInSeconds");
        StartCoroutine("ChangePlayerColorInSeconds");
    }    //awake