Esempio n. 1
0
    /// <summary>
    /// 切换新手引导的样式
    /// </summary>
    /// <param name="style">样式</param>
    /// <param name="pos">位置</param>
    /// <param name="showTxt">显示文字</param>
    /// <param name="targetObj">UIButtonMessage的target变量</param>
    /// <param name="funcName">所调用的方法</param>
    public void SwitchInstructionsBoxStyle(InstructionsBoxStyle style, Transform pos, string showTxt, GameObject targetObj, string funcName)
    {
        if (null == beginnersGuidePanel || null == lblInstruction || null == spriteArrow || null == spriteTalkbox || null == spriteGirl)
        {
            Debug.LogWarning("新手引导指示条某个变量没有赋值!!!!");
            return;
        }
        //TweenPosition tp = beginnersGuidePanel.GetComponentInChildren<TweenPosition>();
        //tp.enabled = false;
        switch (style)
        {
        case InstructionsBoxStyle.LeftTop:
            lblInstruction.localPosition = new Vector3(-260, -35, 0);
            spriteArrow.localPosition    = new Vector3(-407, -3, 0);
            spriteArrow.localScale       = new Vector3(-1, 1, 1);
            spriteTalkbox.localPosition  = new Vector3(-392, -96, 0);
            spriteGirl.localPosition     = new Vector3(-116, -17, 0);
            break;

        case InstructionsBoxStyle.LeftBottom:
            lblInstruction.localPosition = new Vector3(-297, -35, 0);
            spriteArrow.localPosition    = new Vector3(-407, -68, 0);
            spriteArrow.localScale       = new Vector3(-1, 1, 1);
            spriteTalkbox.localPosition  = new Vector3(-392, -96, 0);
            spriteGirl.localPosition     = new Vector3(-116, -17, 0);
            break;

        case InstructionsBoxStyle.RightTop:
            lblInstruction.localPosition = new Vector3(-198, -35, 0);
            spriteArrow.localPosition    = new Vector3(-28, -3, 0);
            spriteArrow.localScale       = Vector3.one;
            spriteTalkbox.localPosition  = new Vector3(-392, -96, 0);
            spriteGirl.localPosition     = new Vector3(-368, -17, 0);
            break;

        case InstructionsBoxStyle.RightBottom:
            lblInstruction.localPosition = new Vector3(-198, -35, 0);
            spriteArrow.localPosition    = new Vector3(-28, -68, 0);
            spriteArrow.localScale       = Vector3.one;
            spriteTalkbox.localPosition  = new Vector3(-392, -96, 0);
            spriteGirl.localPosition     = new Vector3(-368, -17, 0);
            break;
        }
        lblInstruction.GetComponent <UILabel>().text = showTxt;
        //tp.enabled = true;
        beginnersGuidePanel.localPosition = pos.localPosition;

        target       = targetObj;
        functionName = funcName;

        ShowAndHideBeginnersGuide(true);
        isSaveInfoToServer = false;
    }
Esempio n. 2
0
 /// <summary>
 /// 切换新手引导的样式
 /// </summary>
 /// <param name="style">样式</param>
 /// <param name="pos">位置</param>
 /// <param name="showTxt">显示文字</param>
 /// <param name="targetObj">UIButtonMessage的target变量</param>
 /// <param name="funcName">所调用的方法</param>
 /// /// <param name="type">服务器记录玩家行为的协议</param>
 public void SwitchInstructionsBoxStyle(InstructionsBoxStyle style, Transform pos, string showTxt, GameObject targetObj, string funcName, yuan.YuanPhoton.GameScheduleType type)
 {
     this.SwitchInstructionsBoxStyle(style, pos, showTxt, targetObj, funcName);
     gameScheduleType   = type;
     isSaveInfoToServer = true;
 }