コード例 #1
0
    //kasseiLevel 0.0-1.0 cautiouslevel=0.0f -1.0f
    public void Init(float size, Vector3 pos, BassRange bassRange, int kasseiLevel, int cautiousLevel, EatType eatType, Baits[] bate)
    {
        this.parameters.bate = bate;
        isVisible            = false;

        if (pos.y < Constants.Params.bassVisibleInDepth)
        {
            isVisible = true;
        }
        VisibleBass(isVisible);
        bassState = BassState.Back;
        this.parameters.eatType = eatType;

        moveFrequency_still    = Equations.EaseInQuad(kasseiLevel, 0.07f, 0.4f, 1.0f);
        parameters.KASSEILEVEL = kasseiLevel;
        parameters.SURELEVEL   = cautiousLevel;
        transform.localScale   = new Vector3(size * Constants.BassBihaviour.sizeScallingFactor, size * Constants.BassBihaviour.sizeScallingFactor, size * Constants.BassBihaviour.sizeScallingFactor);
        parameters.range       = bassRange;
        transform.position     = pos;

        sizeNanido = Equations.EaseInQuad(transform.localScale.x, 0.0f, 2.0f, 1.0f);
        if (bassRange == BassRange.Top)
        {
            transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
        }
        else
        {
            transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, Random.Range(-25.0f, 25.0f)));
        }

        ChangeState(BassState.Stay);
    }
コード例 #2
0
ファイル: PointStructures.cs プロジェクト: brunoasdfgh/VBF2
    public Bass Instanciate(Vector3 pos, float size, BassRange range, int kassei, int sure, EatType type, Baits[] baits)
    {
        //Instantiate(ObjectToSpawn, areas[0].GetRandomPointInArea(), transform.rotation);

        BassParameters paramsb = new BassParameters();

        paramsb.size           = size;
        paramsb.spawnedPosiion = pos;
        if (paramsb.spawnedPosiion.y > depth)
        {
            paramsb.spawnedPosiion.y = depth;
        }
        paramsb.range       = range;
        paramsb.KASSEILEVEL = kassei;
        paramsb.SURELEVEL   = sure;
        paramsb.eatType     = type;
        paramsb.bate        = baits;
        return(LureSpawner.Instance.SpawnBassOnPoint(paramsb));
    }
コード例 #3
0
    public void CreateTerritory(BassRange bassRange)
    {
        float terrytorySize = 2.0f;

        posOffset     = transform.localScale.x * Constants.BassBihaviour.posOffsetWhenScaleOne;
        terrytorySize = posOffset * 2;

        _territory_Width[0] = transform.position.x - terrytorySize;
        _territory_Width[1] = transform.position.x + terrytorySize;
        _territory_Depth[0] = transform.position.z - terrytorySize;
        _territory_Depth[1] = transform.position.z + terrytorySize;

        switch (bassRange)
        {
        case BassRange.Top:
            Debug.Log("Create territory top");
            parameters.spawnedPosiion = new Vector3(transform.position.x, 0.0f - posOffset, transform.position.z);
            _territory_Height[1]      = 0.0f - posOffset;
            Debug.Log("Create territory top" + _territory_Height[1]);
            _territory_Height[0] = (0.0f - posOffset) - terrytorySize;
            if (_territory_Height[0] < -(GameController.Instance.BottomDepth) + posOffset)
            {
                _territory_Height[0] = -GameController.Instance.BottomDepth + posOffset;
            }
            if (_territory_Height[1] < _territory_Height[0])
            {
                _territory_Height[1] = _territory_Height[0] + 0.2f;
            }
            break;

        case BassRange.Mid:
            parameters.spawnedPosiion = new Vector3(transform.position.x, -Mathf.Abs(GameController.Instance.BottomDepth) / 2.0f, transform.position.z);
            _territory_Height[1]      = parameters.spawnedPosiion.y + (terrytorySize / 2.0f);
            if (_territory_Height[1] > -posOffset)
            {
                _territory_Height[1] = 0.0f - posOffset;
            }
            _territory_Height[0] = parameters.spawnedPosiion.y - (terrytorySize / 2.0f);
            if (_territory_Height[0] < -(GameController.Instance.BottomDepth) + posOffset)
            {
                _territory_Height[0] = -GameController.Instance.BottomDepth + posOffset;
            }
            if (_territory_Height[1] < _territory_Height[0])
            {
                _territory_Height[0] = 0.0f - posOffset;
                _territory_Height[1] = _territory_Height[0] + 0.2f;
            }
            break;

        case BassRange.Bottom:
            parameters.spawnedPosiion = new Vector3(transform.position.x, -GameController.Instance.BottomDepth + posOffset, transform.position.z);
            _territory_Height[1]      = parameters.spawnedPosiion.y + terrytorySize;
            if (_territory_Height[1] > -posOffset)
            {
                _territory_Height[1] = 0.0f - posOffset;
            }
            _territory_Height[0] = parameters.spawnedPosiion.y;
            if (_territory_Height[1] < _territory_Height[0])
            {
                _territory_Height[0] = 0.0f - posOffset;
                _territory_Height[1] = _territory_Height[0] + 0.2f;
            }
            break;
        }
        transform.position = new Vector3(transform.position.x, Random.Range(_territory_Height[0], _territory_Height[1]), transform.position.z);
    }