// 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; } }
// 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); }
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>(); }
private void Start() { controllerTask = GetComponent <ControllerTask>(); }