Example #1
0
 public void SetAishouLbl(UILabel lbl, float aishou)
 {
     if (aishou < -10.0f)
     {
         lbl.text  = "--";
         lbl.color = Color.white;
     }
     else
     {
         if (aishou == 0.0f)
         {
             lbl.text  = Localization.Get("MatchHeavy");
             lbl.color = GUIColors.Instance.MatchColor_Plus;
         }
         else if (aishou < 0.0f)
         {
             lbl.color = GUIColors.Instance.MatchColor_Minus;
             lbl.text  = PSGameUtils.GetPercent(aishou);
         }
         else
         {
             lbl.color = GUIColors.Instance.MatchColor_Plus;
             lbl.text  = PSGameUtils.GetPercent(aishou);
         }
     }
 }
Example #2
0
    public override IEnumerator Init(int currentLure)
    {
        Debug.Log(GetMethodName() + this.name);
        Coroutine cor;

        ShowItemList(false);
        cor = StartCoroutine(SetItemLists());
        yield return(cor);

        CheckEarlyAccess();
        currenEquippedLure = currentLure;
        affecter.topBtn.SetBtnCallback(OnBtnBuy);
        affecter.btmBtn.SetBtnCallback(OnBtnBuySP);

        rader.InitRader(PSGameUtils.SplitStringData(Localization.Get("LineParams_Tittles"), new char[] { ';' }), transform);

        HideAvilities();


        currentSelect = 0;
        OnTappedItem(currentSelect, true);
        yield return(new WaitForSeconds(0.5f));

        Debug.Log(GetMethodName() + this.name + "End");
        WaitAndCover.Instance.StopWait();
        WaitAndCover.Instance.UnCoverAll();
    }
Example #3
0
    //1 購入ボタン 2 アドオン 3 装備
    public void SetMode(BottomMenu menu)
    {
        switch (menu)
        {
        case BottomMenu.Buy:
            PSGameUtils.ActiveNGUIObject(bottomBuyBtns, true);
            PSGameUtils.ActiveNGUIObject(bottomAddons, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipped, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipBtn, false);
            break;

        case BottomMenu.AddOn:
            PSGameUtils.ActiveNGUIObject(bottomBuyBtns, false);
            PSGameUtils.ActiveNGUIObject(bottomAddons, true);
            PSGameUtils.ActiveNGUIObject(bottomEquipped, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipBtn, false);
            break;

        case BottomMenu.Equip:
            PSGameUtils.ActiveNGUIObject(bottomBuyBtns, false);
            PSGameUtils.ActiveNGUIObject(bottomAddons, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipped, true);
            PSGameUtils.ActiveNGUIObject(bottomEquipBtn, false);
            break;

        case BottomMenu.Btn:
            PSGameUtils.ActiveNGUIObject(bottomBuyBtns, false);
            PSGameUtils.ActiveNGUIObject(bottomAddons, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipped, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipBtn, true);
            break;
        }
    }
Example #4
0
    void Update()
    {
        if (lure != null)
        {
            if (GameController.Instance.currentMode != GameMode.Reeling && GameController.Instance.currentMode != GameMode.ReelingOnLand)
            {
                return;
            }
            if (GameController.Instance.GetisNegakariOrFoockingState() || kakuritsu <= 0.0f)
            {
                return;
            }
            if (Player.Instance.distanceToLure - dist < -0.2f)
            {
                dist = Player.Instance.distanceToLure;
                if (PSGameUtils.Chusen(kakuritsu))
                {
                    lure = null;
                    GameController.Instance.OnNegakari();

                    return;
                }
            }
        }
    }
Example #5
0
    public void SetMiddle(bool isShow, bool isSoft)
    {
        if (isShow)
        {
            PSGameUtils.ActiveNGUIObject(middleObj, true);
            topObj.transform.localPosition = new Vector3(-40.2f, 128.34f, 0.0f);
        }
        else
        {
            PSGameUtils.ActiveNGUIObject(middleObj, false);

            if (isSoft)
            {
                topObj.transform.localPosition   = new Vector3(-40.2f, 132.7f, 0.0f);
                equipObj.transform.localPosition = new Vector3(-800f, -559.2f, 0.0f);
                adonObj.transform.localPosition  = new Vector3(-795.6f, -264.3f, 0.0f);
            }
            else
            {
                topObj.transform.localPosition   = new Vector3(-40.2f, -8.28f, 0.0f);
                equipObj.transform.localPosition = new Vector3(-800f, -396.56f, 0.0f);
                adonObj.transform.localPosition  = new Vector3(-40.2f, -396.56f, 0.0f);
            }
        }
    }
Example #6
0
    public bool CheckSameDayLogin(string last, int RenzokuLogin)
    {
        DateTime lastTime = PSGameUtils.StringToDateTime(last);

        SetMonths();

        if (PSGameUtils.IsSameDayLogin(lastTime))
        {
            Debug.Log("TimeManager 同じ日");
            isSameDayLogin = true;
        }
        else
        {
            DataManger.Instance.GAMEDATA.earnedLoginBonus = false;
            isSameDayLogin = false;
            if (PSGameUtils.IsRenzoku(lastTime))
            {
                RenzokuLogin++;
                DataManger.Instance.GAMEDATA.RenzokuLogin = RenzokuLogin;
                Debug.Log("TimeManager 違う日 連続" + DataManger.Instance.GAMEDATA.RenzokuLogin);
                ES2.Save(DataManger.Instance.GAMEDATA.RenzokuLogin, DataManger.DataFilename + "?tag=RenzokuLogin");
            }
            else
            {
                Debug.Log("TimeManager 違う日 連続ブレイク");
                RenzokuLogin = 0;
                DataManger.Instance.GAMEDATA.RenzokuLogin = RenzokuLogin;
            }
            DataManger.Instance.GAMEDATA.earnedLoginBonus = false;
            ES2.Save(DataManger.Instance.GAMEDATA.earnedLoginBonus, DataManger.DataFilename + "?tag=earnedLoginBonus");
            DataManger.Instance.SaveCurrentTime("?tag=lastLoginTime");
        }
        UpdateTime();
        return(isSameDayLogin);
    }
Example #7
0
 public void OnNA()
 {
     ShowNA();
     SetMiddle(true, false);
     PSGameUtils.ActiveNGUIObject(bottomEquipped, false);
     PSGameUtils.ActiveNGUIObject(bottomEquipBtn, false);
     PSGameUtils.ActiveNGUIObject(bottomAddons, false);
 }
Example #8
0
 public void OnRodSoubi()
 {
     SetMiddle(true, false);
     PSGameUtils.ActiveNGUIObject(bottomAddons, false);
     PSGameUtils.ActiveNGUIObject(bottomEquipped, true);
     PSGameUtils.ActiveNGUIObject(bottomEquipBtn, false);
     HideNA();
 }
Example #9
0
 public void SetLureParams(string tittle, string spName, string heavy, UIAtlas at)
 {
     tittleLb.text     = tittle;
     lureSp.atlas      = at;
     lureSp.material   = at.spriteMaterial;
     lureSp.spriteName = spName;
     PSGameUtils.SetUISprite(AdonSp, "");
     markSp.text = heavy;
 }
Example #10
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.layer == LayerMask.NameToLayer("Rure"))
     {
         kakuritsu = PSGameUtils.GetChusenRitsuFromKakuritsu(GetLargestBounds() / 0.2f, (negakarikakuritsu - TackleParams.Instance.tParams.negakariKaihi));
         lure      = LureController.Instance.gameObject;
         Player.Instance.SetDistancePlayer(LureController.Instance.gameObject.transform);
         dist = Player.Instance.distanceToLure;
     }
 }
Example #11
0
    //ルアーの色との相性 50 基準  100が最も悪い 
    int ColorFitess(int visibility)
    {
        int val = 50;

        int fac = (visibility - 50) / 2;

        //-25 25 良い 悪い

        if (fac > 0)
        {
            //視界悪いほど明るい 強く 黒い弱く
            val += (int)(fac * GetDarkness());
            val -= (int)(fac * GetBrightness());
        }
        else
        {
            //視界良い ほどナチュラル強く  他は悪くなる
            val -= (int)(fac * GetDarkness());
            val -= (int)(fac * GetBrightness());
            val += (int)(fac * GetNaturality());
        }

        //25-75

        //25% アースカラーほど強くなる
        if (GameController.Instance.waveParams.waveType_color == WAVETYPE_COLOR.SAND)
        {
            val -= (int)(25 * GetDarkness());
            val -= (int)(25 * GetBrightness());
            val += (int)(25 * GetNaturality());
        }
        else if (GameController.Instance.waveParams.waveType_color == WAVETYPE_COLOR.GREEN)
        {
            val -= (int)(25 * GetDarkness());
            val -= (int)(25 * GetBrightness());
            val += (int)(25 * GetNaturality());
        }
        else if (GameController.Instance.waveParams.waveType_color == WAVETYPE_COLOR.BLUE)
        {
            val -= (int)(25 * GetDarkness());
            val -= (int)(25 * GetBrightness());
            val += (int)(25 * GetNaturality());
        }
        else if (GameController.Instance.waveParams.waveType_color == WAVETYPE_COLOR.CLEAR)
        {
            val += (int)(25 * GetDarkness());
            val += (int)(25 * GetBrightness());
            val -= (int)(25 * GetNaturality());
        }

        //0-100
        val = PSGameUtils.ClampInte(val, 0, 100);
        tParams.colorVividNess = val;
        return(val);
    }
Example #12
0
    public void OnFoocked(float power)
    {
        if (power > 10.0f)
        {
            power = 10.0f;
        }

        if (PSGameUtils.Chusen(0.05f))
        {
            FoockOff();
        }
    }
Example #13
0
    public void OnPluginReady(string YearTittle)
    {
        //""なら 年度が今年ではない or 年度が合えば
        if (YearTittle == "")
        {
            //""なら 年度が今年ではない アップデートを促す
            WaitAndCover.Instance.ShowYesNoPopup(Localization.Get("TittleNoRankingData"), Localization.Get("DescNoRankingData"),
                                                 Localization.Get("Store"), Localization.Get("Quit"), OnUserYNNotThisYear);
        }
        else
        {
            string[] str = PSGameUtils.SplitStringData(YearTittle, new char[] { ':' });
            if (str.Length != 3)
            {
                //フォーマットエラー
                Debug.LogError("フォーマットエラー");
                WaitAndCover.Instance.ShowYesNoPopup("NTYF0" + Localization.Get("FatalError"), Localization.Get("DescFatalError"),
                                                     Localization.Get("Report"), Localization.Get("Quit"), ReportBugOrQuit);
            }
            else
            {
                int year = 0;
                if (int.TryParse(str[0], out year))
                {
                    Debug.Log("年度は今年!! " + year);

                    if (DateTime.Now.Year != year)
                    {
                        //フォーマットエラー
                        Debug.LogError("フォーマットエラー");

                        WaitAndCover.Instance.ShowYesNoPopup("NTYF1" + Localization.Get("FatalError"), Localization.Get("DescFatalError"),
                                                             Localization.Get("Report"), Localization.Get("Quit"), ReportBugOrQuit);
                    }
                    else
                    {
                        //ゲームの開始可能 or データロード可能
                        //今年のapkで 
                        StartCoroutine(LoadDatas());
                        //PS_Plugin.Instance.LoadScene("VBFMain");
                    }
                }
                else
                {
                    //フォーマットエラー
                    Debug.LogError("フォーマットエラー");
                    WaitAndCover.Instance.ShowYesNoPopup("NTYF3" + Localization.Get("FatalError"), Localization.Get("DescFatalError"),
                                                         Localization.Get("Report"), Localization.Get("Quit"), ReportBugOrQuit);
                }
            }
        }
    }
Example #14
0
 public void ShowItemList(bool isRod)
 {
     if (isRod)
     {
         PSGameUtils.ActiveNGUIObject(lurelistObj, false);
         PSGameUtils.ActiveNGUIObject(rodlistObj, true);
     }
     else
     {
         PSGameUtils.ActiveNGUIObject(lurelistObj, true);
         PSGameUtils.ActiveNGUIObject(rodlistObj, false);
     }
 }
Example #15
0
    public bool SetStringData(string str)
    {
        string[] strs = PSGameUtils.SplitStringData(str, new char[] { ';' });
        if (strs.Length != 5)
        {
            Debug.LogError("not match length" + str);
            return(false);
        }

        name = strs[0];
        bool boo = false;

        if (bool.TryParse(strs[1], out boo))
        {
            isMainTackle = boo;
        }
        else
        {
            return(false);
        }

        int num = -1;

        if (int.TryParse(strs[2], out num))
        {
            lineNum = num;
        }
        else
        {
            return(false);
        }
        if (bool.TryParse(strs[3], out boo))
        {
            isSoft = boo;
        }
        else
        {
            return(false);
        }
        if (int.TryParse(strs[4], out num))
        {
            lureNum = num;
        }
        else
        {
            return(false);
        }


        return(true);
    }
Example #16
0
 public void SetRig(string addOnSp, bool shouldShowBack, Vector3 AdonLocalTrans, Vector3 AdonLocalRot)
 {
     PSGameUtils.SetUISprite(AdonSp, addOnSp);
     if (shouldShowBack)
     {
         AdonSp.depth = lureSp.depth - 1;
     }
     else
     {
         AdonSp.depth = lureSp.depth + 1;
     }
     AdonSp.transform.localPosition = AdonLocalTrans;
     AdonSp.transform.localRotation = Quaternion.Euler(AdonLocalRot);
 }
Example #17
0
    public IEnumerator OnEquipSoftInvoke()
    {
        WaitAndCover.Instance.ShowWait();
        WaitAndCover.Instance.CoverAll(false);
        soubiBtn.Hide();
        equipBtn.SetDelegate(OnEquip_Soft);
        affecter2.guiSetter.OnLureChange(false);
        ShowItemList(false);



        equipBtn.rader.InitRader(PSGameUtils.SplitStringData(Localization.Get("TotalLureParams_Tittles"), new char[] { ';' }), transform);
        //現在のルアー
        int i = DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].lureNum;

        Debug.Log("現在の装備 " + i + " " + DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].isSoft);
        currentChangeSelect = i;


        equipBtn.SetAishouTotal(GetAishouLure(currentSelect, currentChangeSelect, true)
                                , GetAishouLine(currentSelect, DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].lineNum));
        equipBtn.SetAishouCurrent(GetAishouLure(currentSelect, currentChangeSelect, true));


        yield return(new WaitForSeconds(0.5f));

        if (currentChangeSelect == -1)
        {
            Debug.Log("現在の装備はソフトではない");
            //何もない
            equipSoft.Show(0);
            SetCurrentLure(currentSelect, 0);
            currentChangeSelect = 0;
        }
        else
        {
            Debug.Log("現在の装備はソフト");
            currentChangeSelect = 0;
            int currentRigID = equipSoft.GetEquippedRigID(currentChangeSelect);
            equipSoft.Show(currentChangeSelect);

            SetCurrentLure(currentSelect, currentRigID);
        }

        OnSelect_Soft(currentChangeSelect);

        WaitAndCover.Instance.StopWait();
        WaitAndCover.Instance.UnCoverAll();
    }
Example #18
0
    //パラメータを更新する
    public void UpdateLure()
    {
        string str = "";

        if (!currentTackle.isSoft)
        {
            str             = Constants.LureDatas.avility[currentTackle.lureNum];
            tParams.avility = PSGameUtils.StringToBoolArray(str);
        }
        else
        {
            int currentRig = GetEquippedRigID(currentTackle.lureNum);
            tParams.avility = PSGameUtils.MergeAvility(Constants.RigDatas.avilitys[currentRig], Constants.SoftLureDatas.avilitys[currentTackle.lureNum]);
        }
    }
Example #19
0
 public void SetActive(bool isOn, bool isActive)
 {
     //Debug.Log("PS_Toggle SetActive"+isOn+" "+isActive);
     PSGameUtils.ActiveNGUIObject(gameObject, isOn);
     if (isOn)
     {
         if (isActive)
         {
             gameObject.GetComponent <UISprite>().alpha = 1.0f;
         }
         else
         {
             gameObject.GetComponent <UISprite>().alpha = 0.3f;
         }
     }
 }
Example #20
0
    public void OnLureChange(bool isHard)
    {
        SetMiddle(false, isHard?false:true);
        HideNA();
        PSGameUtils.ActiveNGUIObject(bottomEquipped, false);

        if (isHard)
        {
            PSGameUtils.ActiveNGUIObject(bottomAddons, false);
            PSGameUtils.ActiveNGUIObject(bottomEquipBtn, true);
        }
        else
        {
            PSGameUtils.ActiveNGUIObject(bottomAddons, true);
            PSGameUtils.ActiveNGUIObject(bottomEquipBtn, true);
        }
    }
Example #21
0
    public IEnumerator OnEquipLineInvoke()
    {
        WaitAndCover.Instance.ShowWait();
        WaitAndCover.Instance.CoverAll(false);
        soubiBtn.Hide();
        equipBtn.SetDelegate(OnEquip_Line);
        ShowItemList(false);
        affecter2.guiSetter.OnLureChange(true);
        equipBtn.rader.InitRader(PSGameUtils.SplitStringData(Localization.Get("TotalLureParams_Tittles"), new char[] { ';' }), transform);
        //現在のルアー
        int i = DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].lineNum;

        currentChangeSelect = i;

        equipBtn.SetAishouTotal(GetAishouLure(currentSelect, DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].lureNum,
                                              DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].isSoft), GetAishouLine(currentSelect, currentChangeSelect));
        equipBtn.SetAishouCurrent(GetAishouLine(currentSelect, currentChangeSelect));

        yield return(new WaitForSeconds(0.5f));

        if (currentChangeSelect == -1)
        {
            //何もない
            equipLine.Show(0);
            equipBtn.SetCurrent("", "", equipLine.itemAtlas);
            currentChangeSelect = 0;
        }
        else
        {
            currentChangeSelect = 0;
            equipLine.Show(currentChangeSelect);
            //レーダーを表示する。 現在のライン→セレクトされたライン
            equipBtn.SetCurrent(Constants.LineDatas.itemTittles[i], Constants.LineDatas.itemSprites[i], equipLine.itemAtlas);
        }



        OnSelect_Line(currentChangeSelect);

        WaitAndCover.Instance.StopWait();
        WaitAndCover.Instance.UnCoverAll();
    }
Example #22
0
    void OnStillDelayed()
    {
        //set still delay!
        ZeroElapsedTime();
        switch (bassState)
        {
        case BassState.Chase:

            positionOffset = PSGameUtils.GetPointAroundPosition(LureController.Instance.gameObject.transform.position, Random.Range(Constants.BassBihaviour.minDistanceWhenChaseScaleOne, Constants.BassBihaviour.maxDistanceWhenChaseScaleOne));
            delayStill     = Random.Range(1.0f - parameters.KASSEILEVEL, 2.0f - parameters.KASSEILEVEL);

            break;

        case BassState.Fight:
            positionOffset = GetRandomFloatingPosition();
            break;

        case BassState.Stay:

            if (isAttentioned)
            {
                positionOffset = PSGameUtils.GetPointAroundPosition(LureController.Instance.gameObject.transform.position, Random.Range(Constants.BassBihaviour.minDistanceWhenChaseScaleOne, Constants.BassBihaviour.maxDistanceWhenChaseScaleOne));

                delayStill = Random.Range(1.0f - parameters.KASSEILEVEL, 2.0f - parameters.KASSEILEVEL);
            }
            else
            {
                if (moveFrequency_still >= Random.value)
                {
                    Debug.Log("decide to move");
                    GetNewPoint(GetRandomPositionInTerritory(), true, true, Random.Range(0.0f, 0.1f), 4.0f, 0.0f);
                }
                else
                {
                    delayStill     = Random.Range(2.0f, 6.0f);
                    positionOffset = GetRandomFloatingPosition();
                }
            }
            break;
        }
    }
Example #23
0
 public void SetLureParams(string tittle, string spName, UIAtlas at)
 {
     if (tittle == "")
     {
         tittleLb.text     = tittle;
         lureSp.atlas      = at;
         logo.enabled      = true;
         lureSp.material   = at.spriteMaterial;
         lureSp.spriteName = spName;
         PSGameUtils.SetUISprite(AdonSp, "");
     }
     else
     {
         logo.enabled      = false;
         tittleLb.text     = tittle;
         lureSp.atlas      = at;
         lureSp.material   = at.spriteMaterial;
         lureSp.spriteName = spName;
         PSGameUtils.SetUISprite(AdonSp, "");
     }
 }
Example #24
0
    public override IEnumerator Init(int currentLure)
    {
        Coroutine cor;

        ShowItemList(true);
        cor = StartCoroutine(SetItemLists());
        yield return(cor);

        currenEquippedLure = currentLure;

        rader.InitRader(PSGameUtils.SplitStringData(Localization.Get("RodsParams_Tittles"), new char[] { ';' }), transform);
        HideAvilities();
        //currentSelect=0;
        OnTappedItem(currentSelect, true);
        yield return(new WaitForSeconds(0.5f));

        //Debug.LogError("Init  ");
        soubiBtn.Show(Localization.Get("Equip"));
        WaitAndCover.Instance.StopWait();
        WaitAndCover.Instance.UnCoverAll();
    }
Example #25
0
 public void setCK(string data)
 {
     bool[] dat = new bool[6] {
         false, false, false, false, false, false
     };
     if (data != "")
     {
         dat = PSGameUtils.StringToBoolArray(data);
         if (dat.Length != avilTs.Length)
         {
             Debug.LogError("not match ");
             dat = new bool[6] {
                 false, false, false, false, false, false
             };
         }
     }
     for (int i = 0; i < avilTs.Length; i++)
     {
         avilTs[i].value = dat[i];
     }
 }
Example #26
0
    public IEnumerator OnEquipHardInvoke()
    {
        WaitAndCover.Instance.ShowWait();
        WaitAndCover.Instance.CoverAll(false);
        equipBtn.SetDelegate(OnEquip_Hard);
        affecter.SetMode(BottomMenu.Btn);
        equipBtn.rader.InitRader(PSGameUtils.SplitStringData(Localization.Get("TotalLureParams_Tittles"), new char[] { ';' }), transform);
        //現在のルアー
        int i = DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].lureNum;

        Debug.Log("現在の装備 " + i + " " + DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].isSoft);
        currentChangeSelect = i;

        equipBtn.SetAishouTotal(GetAishouLure(currentSelect, currentChangeSelect, false), GetAishouLine(currentSelect, DataManger.Instance.GAMEDATA.tackleSlots[currentSelect].lineNum));
        equipBtn.SetAishouCurrent(GetAishouLure(currentSelect, currentChangeSelect, false));
        yield return(new WaitForSeconds(0.5f));

        if (currentChangeSelect == -1)
        {
            //何もない
            Debug.Log("現在の装備はハードではない");
            equipHard.Show(0);
            currentChangeSelect = 0;
            SetCurrentLure(currentSelect, 0);
        }
        else
        {
            currentChangeSelect = 0;
            equipHard.Show(currentChangeSelect);
            SetCurrentLure(currentSelect, 0);
        }



        OnSelect_Hard(currentChangeSelect);

        WaitAndCover.Instance.StopWait();
        WaitAndCover.Instance.UnCoverAll();
    }
Example #27
0
 void HideNA()
 {
     PSGameUtils.ActiveNGUIObject(bottomBuyBtns, false);
 }
Example #28
0
 void ShowNA()
 {
     PSGameUtils.ActiveNGUIObject(bottomBuyBtns, true);
 }
Example #29
0
    void MoveToTarget()
    {
        switch (bassState)
        {
        case BassState.Fight:
            if (Player.Instance.GetDistanceoPlayer() < Constants.Params.kaishuDistance)
            {
                Debug.LogError("very close player ");
            }
            _stuckCounter += Time.deltaTime * (howLongToDetectReached * 0.25f);
            Move(true);
            break;

        case BassState.Bite:
            timeReached   = 0.0f;
            _stuckCounter = timeReached;
            if (Player.Instance.GetDistanceoPlayer() < Constants.Params.kaishuDistance)
            {
                Debug.LogError("very close player ");
                GameController.Instance.BassIsChasing(false, null);
                ChangeState(BassState.Back);
            }
            moveTarget = LureController.Instance.gameObject.transform.position;
            Move(true);
            break;

        case BassState.Chase:
            //moving
            if (Player.Instance.GetDistanceoPlayer() < Constants.Params.kaishuDistance)
            {
                Debug.LogError("very close player ");
                GameController.Instance.BassIsChasing(false, null);
                ChangeState(BassState.Back);
            }
            if (LureController.Instance.appeal.moveState == 0)
            {
                //rure stopped
                Debug.LogError("rure stopped set to still ");
                CheckRureMoveGetAppealled();
                stillTimeMax     = 0.0f;
                timeBassIsBoring = 10.0f * parameters.KASSEILEVEL;
                delayStill       = delayEvery * Random.Range(0.5f, 0.99f);
                _turnSpeed       = Random.Range(minTurnSpeed, maxTurnSpeed);
                positionOffset   = PSGameUtils.GetPointAroundPosition(LureController.Instance.gameObject.transform.position, Random.Range(Constants.BassBihaviour.minDistanceWhenChaseScaleOne, Constants.BassBihaviour.maxDistanceWhenChaseScaleOne));

                isReachedMovePosition = true;
                return;
            }
            CheckRureMoveGetAppealled();
            timeReached   = 0.0f;
            _stuckCounter = timeReached;

            moveTarget = LureController.Instance.gameObject.transform.position;
            if (distance < howLongToDetectReached * 2)
            {
                if (speedWhenDeccerate == 0.0f)
                {
                    speedWhenDeccerate = _speed;
                    tParam             = 2.0f;
                }
                Move(false);
            }
            else
            {
                if (tParam < -1.0f)
                {
                    tParam = Mathf.InverseLerp(0.0f, _targetSpeed, _speed);
                }
                speedWhenDeccerate = 0.0f;
                Move(true);
            }
            break;

        case BassState.Stay:
            if (isAttentioned)
            {
                if (Player.Instance.GetDistanceoPlayer() < Constants.Params.kaishuDistance)
                {
                    Debug.LogError("very close player ");
                    GameController.Instance.BassIsChasing(false, null);
                    ChangeState(BassState.Back);
                }
                if (LureController.Instance.appeal.moveState == 0)
                {
                    //rure stopped
                    CheckRureMoveGetAppealled();
                    stillTimeMax     = 0.0f;
                    timeBassIsBoring = 10.0f * parameters.KASSEILEVEL;
                    Debug.LogError("rure stopped wait for " + timeBassIsBoring + " sec");
                    delayStill     = delayEvery * Random.Range(0.5f, 0.99f);
                    _turnSpeed     = Random.Range(minTurnSpeed, maxTurnSpeed);
                    positionOffset = PSGameUtils.GetPointAroundPosition(LureController.Instance.gameObject.transform.position, Random.Range(Constants.BassBihaviour.minDistanceWhenChaseScaleOne, Constants.BassBihaviour.maxDistanceWhenChaseScaleOne));

                    isReachedMovePosition = true;
                    return;
                }

                //moving
                timeReached   = 0.0f;
                _stuckCounter = timeReached;
                moveTarget    = LureController.Instance.gameObject.transform.position;
                if (distance < howLongToDetectReached * 2)
                {
                    if (speedWhenDeccerate == 0.0f)
                    {
                        speedWhenDeccerate = _speed;
                        tParam             = -2.0f;
                    }
                    Move(false);
                }
                else
                {
                    if (tParam < -1.0f)
                    {
                        tParam = Mathf.InverseLerp(0.0f, _targetSpeed, _speed);
                    }
                    speedWhenDeccerate = 0.0f;
                    Move(true);
                }
            }
            else
            {
                _stuckCounter += Time.deltaTime * (howLongToDetectReached * 0.25f);
                Move(true);
            }
            break;
        }
    }
Example #30
0
 public void SetActive(bool isActive)
 {
     PSGameUtils.ActiveNGUIObject(gameObject, isActive);
 }