Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject go = new GameObject();

        go.transform.parent = gameObject.transform;
        text                       = go.AddComponent <Text>();
        text.alignment             = TextAnchor.MiddleCenter;
        text.color                 = Color.black;
        text.verticalOverflow      = VerticalWrapMode.Overflow;
        text.fontSize              = 150;
        go.transform.localPosition = Vector3.zero;
        RectTransform rectTransform = go.GetComponent <RectTransform>();

        rectTransform.sizeDelta = Vector2.one * 2000;
        text.font = Resources.GetBuiltinResource <Font>("Arial.ttf");

        nowSelect      = 0;
        controllerTask = GetComponent <ControllerTask>();
        texts          = Resources.LoadAll <TextAsset>(GetPath.Txt);
        stageNum       = texts.Length;
        stageText      = new string[texts.Length];
        for (int i = 0; i < texts.Length; i++)
        {
            stageText[i] = texts[i].name;
        }
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Awake()
    {
        controllerTask = Utility.GetTaskObject().GetComponent <ControllerTask>();
        mainCamera     = GameObject.FindGameObjectWithTag("MainCamera");
        mainCamera.GetComponent <CameraTask>().player = gameObject;
        playerMove   = gameObject.AddComponent <PlayerMove>();
        objectChoice = gameObject.AddComponent <ObjectChoice>();
        gameTask     = Utility.GetGameTask();

        pos = Utility.PositionToData(transform.position);
    }
Ejemplo n.º 3
0
 void Awake()
 {
     moveObjectTask  = gameObject.AddComponent <MoveObjectTask>();
     stageCreateTask = gameObject.AddComponent <StageCreateTask>();
     uiTask          = gameObject.AddComponent <GameUiTask>();
     mapObjects      = new List <MapObject>();
     stageCreateTask.MapDataCreate(GetPath.Txt + "/" + stageName, mapObjects, ref stageData);
     Special        = new SpecialObject();
     textEvent      = false;
     eventCount     = 0;
     controllerTask = GetComponent <ControllerTask>();
     drawFloorTask  = GetComponent <DrawingFloorTask>();
 }
Ejemplo n.º 4
0
 private void Start()
 {
     controllerTask = GetComponent <ControllerTask>();
 }