Beispiel #1
0
    void ActiveRunPlayer()
    {
        if (ShootPlayerPath == null)
        {
            Debug.LogError("ActiveRunPlayer -> ShootPlayerPath was null!");
            return;
        }

        if (IsActiveRunPlayer)
        {
            return;
        }
        IsActiveRunPlayer = true;
        Debug.Log("ActiveRunPlayer...");

        PlayerObj  = gameObject;
        PlayerTran = transform;

        if (pathCount <= 0)
        {
            CartoonShootCamCtrl.GetInstance().CheckGenSuiCamTranStartGame();
            if (ShootPlayerMark != null)
            {
                MarkCurrentIndex = ShootPlayerMark.MarkIndex;
                ShootPlayerPath  = ShootPlayerMark.ShootPlayerPath;
                PlayerPathTran   = ShootPlayerPath.transform;
            }
            else
            {
                MarkCurrentIndex = 0;
                PlayerPathTran   = ShootPlayerPath.transform;
            }
            PlayerTran.position = PlayerPathTran.GetChild(MarkCurrentIndex).position;
            PlayerTran.rotation = PlayerPathTran.GetChild(MarkCurrentIndex).rotation;
        }
        else
        {
            MarkCurrentIndex = 0;
            PlayerPathTran   = ShootPlayerPath.transform;
        }

        MovePlayerByShootPath();
        pathCount++;
    }
    void ActivePlayerFollowCamera()
    {
        this.enabled        = false;
        NoiseScript.enabled = false;
        GameCtrlXK.GetInstance().ShowAllGUI();
        StartGameTimeCtrl.GetInstance().DelayPlayTime();
        WaterwheelCameraCtrl.GetInstance().ActivePlayerFollowCamera();
        InputEventCtrl.GetInstance().ClickStartBtOneEvent -= clickStartBtOneEvent;

        if (GameCtrlXK.GetInstance().PlayerMarkTest == null)
        {
            PlayerAutoFire.ResetIsRestartMove();
        }
        Debug.Log("ActivePlayerFollowCamera....");

        if (CartoonShootCamCtrl.GetInstance() != null)
        {
            CartoonShootCamCtrl.GetInstance().CheckGenSuiCamTranStartGame();
        }
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = CartoonShootCamCtrl.GZhuJiaoTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 15f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - CartoonShootCamCtrl.GZhuJiaoTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                IsActiveShootCamera = true;
                gameObject.SetActive(false);

                if (IsActiveResetWorldTime)
                {
                    IsActiveResetWorldTime = false;
                    Invoke("DelayCheckResetWorldTime", 0.3f);
                }
                else
                {
                    DelayCheckResetWorldTime();
                }
                TimeRecord     = Time.realtimeSinceStartup;
                Time.timeScale = WorldTime;

                for (int i = 0; i < ActionState.Length; i++)
                {
                    if (AniComponent[i] != null)
                    {
                        AniComponent[i].SetBool(ActionState[i], true);
                    }
                }

                switch (CamState)
                {
                case CartoonShootCamState.GenSuiCamera:
                    CartoonShootCamCtrl.GetInstance().ActiveGenSuiCamera(GenSuiTran);
                    break;

                case CartoonShootCamState.DingDianMiaoZhunCamera:
                    CartoonShootCamCtrl.GetInstance().ActiveDingDianMiaoZhunCamera(DingDianTranCamPoint,
                                                                                   DingDianMiaoZhunTranAimPoint);
                    break;

                case CartoonShootCamState.DingDianBuMiaoZhunCamera:
                    CartoonShootCamCtrl.GetInstance().ActiveDingDianBuMiaoZhunCamera(DingDianTranCamPoint);
                    break;

                case CartoonShootCamState.ZiYouYiDongCamera:
                    CartoonShootCamCtrl.GetInstance().ActiveZiYouYiDongCamera(ZiYouYiDongTranCamPath);
                    break;
                }
            }
        }
    }