コード例 #1
0
    public override void Initialize(Transform location, ToolComponentReferences references)
    {
        _controls = new InputMaster();
        _controls.Fishing.Enable();

        _resources = references.CastingComponentList.WaitingResources;

        Prefab = Instantiate(_resources.CastingWaitingPrefab, location.transform.position, location.transform.rotation);
        CastingComponentHolder c = Prefab.GetComponent <CastingComponentHolder>();

        _fishingTarget   = c.FishingTarget;
        _fishingProgress = c.FishingProgress;
        _castingArc      = c.CastingArc;
        _castingTarget   = c.CastingTarget;

        _castingTarget.SetActive(false);
        _castingArc.SetActive(false);
        _fishingProgress.SetActive(false);

        SetValues();

        _fishingState = 1;

        _controls.Fishing.FishingMovement.performed += ctx => _fishingMovementForce = ctx.ReadValue <Vector2>();
        _controls.Fishing.FishingMovement.canceled  += ctx => _fishingMovementForce = Vector2.zero;
    }
コード例 #2
0
    public override void Initialize(Transform location, ToolComponentReferences references)
    {
        _resources = references.CastingComponentList.WaitingResources;

        Prefab = Instantiate(_resources.CastingWaitingPrefab, location.transform.position, location.transform.rotation);
        CastingComponentHolder c = Prefab.GetComponent <CastingComponentHolder>();

        _fishingTarget   = c.FishingTarget;
        _fishingProgress = c.FishingProgress;
        _castingArc      = c.CastingArc;
        _castingTarget   = c.CastingTarget;

        _castingTarget.SetActive(false);
        _castingArc.SetActive(false);
        _fishingProgress.SetActive(false);

        SetValues();

        _fishingState = 1;
    }