Ejemplo n.º 1
0
    /// <summary>
    /// 特写单个角色摄像机以及角色移动细节操作
    /// </summary>
    /// <param name="mode"></param>
    /// <param name="featureCharacter"></param>
    private void OnOnlyOneCharacterFeatureFished(FeatureMode mode, GameObject featureCharacter)
    {
        Vector3 screenVec = Vector3.zero;

        if (mode == FeatureMode.left)
        {
            screenVec = new Vector3((Screen.width / 4), 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z));
        }

        else if (mode == FeatureMode.right)
        {
            screenVec = new Vector3((Screen.width / 4) * 3, 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z));
        }
        TweenPosition characterTP = featureCharacter.GetComponent <TweenPosition>();
        TweenRotation cameraTR    = main_Camera.GetComponent <TweenRotation>();

        Vector3 targetVec = Camera.main.ScreenToWorldPoint(screenVec);

        targetVec = targetVec - curBG.transform.position;
        featureCharacter.transform.position = targetVec;

        cameraTR.enabled = true;
        Vector3 fromVec = new Vector3(0, main_Camera.transform.rotation.eulerAngles.y, 0);

        if (fromVec.y > 180)
        {
            fromVec.y = fromVec.y - 360;
        }
        cameraTR.from = fromVec;


        cameraTR.duration = 3;
        cameraTR.onFinished.Clear();


        characterTP.enabled  = true;
        characterTP.from     = featureCharacter.transform.position;
        characterTP.duration = 3.0f;
        characterTP.onFinished.Clear();


        if (mode == FeatureMode.left)
        {
            cameraTR.to    = new Vector3(0, fromVec.y, 3);
            characterTP.to = new Vector3(featureCharacter.transform.position.x + 1, featureCharacter.transform.position.y, 0);
            cameraTR.ResetToBeginning();
            characterTP.ResetToBeginning();
        }

        else if (mode == FeatureMode.right)
        {
            cameraTR.to    = new Vector3(0, fromVec.y, -3);
            characterTP.to = new Vector3(featureCharacter.transform.position.x - 1, featureCharacter.transform.position.y, 0);
            cameraTR.ResetToBeginning();
            characterTP.ResetToBeginning();
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new operation with the specified parameters
 /// </summary>
 /// <param name="parentId">Parent operation ID</param>
 /// <param name="name">Name of the new operation</param>
 /// <param name="twoFactor">Two factor (OTP) mode (optional)</param>
 /// <param name="lockOnRequest">Lock on request (LOR) mode (optional)</param>
 /// <returns>If everything goes well, a <code>LatchResponse</code> object containing the new operation ID</returns>
 public LatchResponse CreateOperation(string parentId, string name, FeatureMode twoFactor = FeatureMode.DISABLED, FeatureMode lockOnRequest = FeatureMode.DISABLED)
 {
     var data = new Dictionary<string, string>();
     data.Add("parentId", parentId);
     data.Add("name", name);
     data.Add("two_factor", twoFactor.ToString());
     data.Add("lock_on_request", lockOnRequest.ToString());
     return HTTP_PUT_proxy(API_OPERATION_URL, data);
 }
Ejemplo n.º 3
0
 public override void UnpackTransactionData(Unpacker unpacker, ushort size)
 {
     base.UnpackTransactionData(unpacker, size);
     _mode = (FeatureMode)unpacker.UnpackByte();
     if (!ValidMode)
     {
         throw new Exception("FeatureMode invalid");
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new operation with the specified parameters
        /// </summary>
        /// <param name="parentId">Parent operation ID</param>
        /// <param name="name">Name of the new operation</param>
        /// <param name="twoFactor">Two factor (OTP) mode (optional)</param>
        /// <param name="lockOnRequest">Lock on request (LOR) mode (optional)</param>
        /// <returns>If everything goes well, a <code>LatchResponse</code> object containing the new operation ID</returns>
        public LatchResponse CreateOperation(string parentId, string name, FeatureMode twoFactor = FeatureMode.DISABLED, FeatureMode lockOnRequest = FeatureMode.DISABLED)
        {
            var data = new Dictionary <string, string>();

            data.Add("parentId", parentId);
            data.Add("name", name);
            data.Add("two_factor", twoFactor.ToString());
            data.Add("lock_on_request", lockOnRequest.ToString());
            return(HttpPerformRequest(API_OPERATION_URL, HttpMethod.PUT, data));
        }
Ejemplo n.º 5
0
    /// <summary>
    /// 双人特写(玩家与NPC  玩家固定在左,NPC固定在右
    /// </summary>
    /// <param name="bgEnum"></param>
    /// <param name="player"></param>
    /// <param name="player_AnimatorName"></param>
    /// <param name="npc"></param>
    /// <param name="Npc_AnimatorName"></param>
    public void Feature(FeatureMode mode, NPCAnimatorManager.BGEnmu bgEnum, string player_AnimatorName, string npcName, string Npc_AnimatorName)
    {
        Transform bg = null;

        if (bgEnum == NPCAnimatorManager.BGEnmu.ShenShe)
        {
            bg = GameObject.FindWithTag("ShenSheBG").transform;
        }

        else if (bgEnum == NPCAnimatorManager.BGEnmu.Village)
        {
            bg = GameObject.FindWithTag("VillageBG").transform;
        }
        curBG = bg;
        GameObject player = GameObject.FindWithTag("Player");

        leftCharacter = player;
        GameObject npcCharacter = bg.transform.FindRecursively(npcName).gameObject;

        rightCharacter = npcCharacter;
        savaPos_1      = player.transform.position;
        savaPos_2      = npcCharacter.transform.localPosition;
        for (int i = 0; i < bg.transform.childCount; i++)
        {
            GameObject     go     = bg.transform.GetChild(i).gameObject;
            SpriteRenderer render = go.GetComponent <SpriteRenderer>();
            if (render != null)
            {
                if (go != player || go != npcCharacter)
                {
                    Material[] m_Materials = new Material[1];
                    m_Materials[0]   = ResourcesManager.Instance.LoadMaterial("Blur");
                    render.materials = m_Materials;
                    render.material.SetFloat("_BlurSize", 3);
                }

                else
                {
                    Material[] m_Materials = new Material[1];
                    m_Materials[0]   = ResourcesManager.Instance.LoadMaterial("Normal");
                    render.materials = m_Materials;
                }
            }
        }
        Material[] Materials = new Material[1];
        Materials[0] = ResourcesManager.Instance.LoadMaterial("Normal");

        player.GetComponent <SpriteRenderer>().materials       = Materials;
        npcCharacter.GetComponent <SpriteRenderer>().materials = Materials;
        BattleCamera.Instance.needMoveWithPlayer = false;
        main_Camera.fieldOfView = 120f;
        OnOnlyOneCharacterFeatureFished(mode);
        Rigidbody playerRgb = player.transform.GetComponent <Rigidbody>();

        playerRgb.isKinematic = true;
        Rigidbody npcRgb = npcCharacter.transform.GetComponent <Rigidbody>();

        npcRgb.isKinematic = true;
        PlayerControl.Instance.PlayPlayerSkill(player_AnimatorName);
        NPCAnimatorManager.Instance.PlayCharacterAnimator(npcCharacter, Npc_AnimatorName);
        AudioManager.Instance.PlayEffect_Source("FeatureNormal");
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 双人特写细节处理
    /// </summary>
    /// <param name="mode"></param>
    private void OnOnlyOneCharacterFeatureFished(FeatureMode mode)
    {
        Vector3       screenVec_left  = new Vector3((Screen.width / 4), 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z));
        Vector3       screenVec_right = new Vector3((Screen.width / 4) * 3, 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z));
        TweenPosition leftTP          = leftCharacter.GetComponent <TweenPosition>();
        TweenPosition rightTP         = rightCharacter.GetComponent <TweenPosition>();
        TweenRotation cameraTR        = main_Camera.GetComponent <TweenRotation>();


        Vector3 leftTargetVec = Camera.main.ScreenToWorldPoint(screenVec_left);

        if (leftCharacter.name != "Player")
        {
            Transform parentTF = leftCharacter.transform.parent;
            leftTargetVec = leftTargetVec - parentTF.position;
        }
        Vector3   rightTargetVec = Camera.main.ScreenToWorldPoint(screenVec_right);
        Transform parentTF_Right = rightCharacter.transform.parent;

        rightTargetVec = rightTargetVec - parentTF_Right.position;

        leftCharacter.transform.localPosition  = leftTargetVec;
        rightCharacter.transform.localPosition = rightTargetVec;


        leftTP.enabled         = true;
        leftTP.from            = leftTP.transform.localPosition;
        leftTP.duration        = 2.0f;
        leftTP.ignoreTimeScale = false;
        leftTP.onFinished.Clear();

        rightTP.enabled         = true;
        rightTP.from            = rightTP.transform.localPosition;
        rightTP.duration        = 2.0f;
        rightTP.ignoreTimeScale = false;
        rightTP.onFinished.Clear();


        cameraTR.enabled = true;
        cameraTR.onFinished.Clear();
        Vector3 fromVec = new Vector3(0, main_Camera.transform.rotation.eulerAngles.y, main_Camera.transform.rotation.eulerAngles.z);

        if (fromVec.y > 180)
        {
            fromVec.y = fromVec.y - 360;
        }

        if (fromVec.z > 180)
        {
            fromVec.z = fromVec.z - 360;
        }
        cameraTR.from = fromVec;
        if (mode == FeatureMode.left)
        {
            leftTP.to   = new Vector3(leftTargetVec.x + 0.6f, leftTargetVec.y, 0);
            rightTP.to  = new Vector3(rightTargetVec.x + 0.4f, rightTargetVec.y, 0);
            cameraTR.to = new Vector3(0, fromVec.y, 3);
        }

        else if (mode == FeatureMode.right)
        {
            leftTP.to   = new Vector3(leftTargetVec.x - 0.4f, leftTargetVec.y, 0);
            rightTP.to  = new Vector3(rightTargetVec.x - 0.6f, rightTargetVec.y, 0);
            cameraTR.to = new Vector3(0, fromVec.y, -3);
        }
        leftTP.ResetToBeginning();
        rightTP.ResetToBeginning();
        cameraTR.ResetToBeginning();
    }
Ejemplo n.º 7
0
 /// <summary>
 /// Updates an existing operation with one or more of the specified parameters
 /// </summary>
 /// <param name="operationId">Operation ID to change</param>
 /// <param name="name">New name of the operation (optional)</param>
 /// <param name="twoFactor">New two factor (OTP) mode (optional)</param>
 /// <param name="lockOnRequest">New lock on request (LOR) mode (optional)</param>
 /// <returns>If everything goes well, an empty response</returns>
 public LatchResponse UpdateOperation(string operationId, string name, FeatureMode? twoFactor = null, FeatureMode? lockOnRequest = null)
 {
     var data = new Dictionary<string, string>();
     if (!String.IsNullOrEmpty(name))
         data.Add("name", name);
     if (twoFactor.HasValue)
         data.Add("two_factor", twoFactor.ToString());
     if (lockOnRequest.HasValue)
         data.Add("lock_on_request", lockOnRequest.ToString());
     return HttpPerformRequest(API_OPERATION_URL + "/" + UrlEncode(operationId), HttpMethod.POST, data);
 }
Ejemplo n.º 8
0
    public FeatureMode getMode(int feature)
    {
        FeatureMode ret = (FeatureMode)yarpPINVOKE.IFrameGrabberControls_getMode__SWIG_1(swigCPtr, feature);

        return(ret);
    }
Ejemplo n.º 9
0
    public virtual bool setMode(int feature, FeatureMode mode)
    {
        bool ret = yarpPINVOKE.IFrameGrabberControls_setMode(swigCPtr, feature, (int)mode);

        return(ret);
    }
Ejemplo n.º 10
0
    public FeatureMode toFeatureMode(bool _auto)
    {
        FeatureMode ret = (FeatureMode)yarpPINVOKE.IFrameGrabberControls_toFeatureMode(swigCPtr, _auto);

        return(ret);
    }