Exemplo n.º 1
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);
    }
Exemplo n.º 2
0
    private bool okFlag;    //これがないと決定と選択の1回で処理を行ってしまう

    private void Start()
    {
        basePos  = new Vector2(150f, -100f);
        gameTask = Utility.GetGameTask();
        uiTask   = Utility.GetTaskObject().GetComponent <GameUiTask>();

        Sprite sprite = Resources.Load <Sprite>(GetPath.Image + "/choice");

        choiceMark = uiTask.NewImageUi(sprite, Vector2.zero, Vector2.one * 50f).gameObject;
        choiceMark.transform.eulerAngles = Vector3.forward * 90f;
        choiceMark.SetActive(false);
        objectChoice = GameObject.FindGameObjectWithTag("Player").GetComponent <ObjectChoice>();
    }
Exemplo n.º 3
0
    public override bool UseIf(int itemNum)
    {
        ObjectChoice objectChoice = gameTask.playerTask.objectChoice;
        Vector3Int   pos          = objectChoice.choiceObjects[objectChoice.choiceNum].pos;

        if (pos.x == 0)
        {
            return(false);
        }

        //飛び降りれない場所なら
        int mapId = Array.IndexOf(gameTask.Special.FallObject, gameTask.stageData[pos.x - 1][pos.y][pos.z]);

        return(mapId != -1);
    }