Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(196评价)
价格: 4039.00元

完善UIManager

1.GameUIManager()

定义GameBasePanel

dayNightPanel,wolfPanel,guardPanel,witchPanel,prophetPanel,hunterPanel

完善任务链wolfPanel.SetNextPanel(witchPanel).SetNextPanel(prophetPanel).SetNextPanel(hunterPanel).SetNextPanel(defenderPanel).SetNextPanel(dayNightPanel).SetNextPanel(wolfPanel);

字典添加界面内容

UIPanelDict[UIPanelTypeWolfPanel].Show();

GameBasePanel firstPanel=UIPanelDict[UIPanelType.WolfPanel] as GameBasePanel;

firstPanel.EnterPanel();

firstPanel.HandleGameAcition(UIPanel.WolfPanel);

2.BasePanel()

ChangePanelCallBack(UIPanelType otherPanel)函数增加

if(uiManager.isGameUIManager){

GameBasePanel nextPanel=uiManager.UIPanelDict[otherPanel] as GameBasePanel;

nextPanel.HandleGameAction(otherPanel);}

[展开全文]
lix0824 · 2018-08-08 · 0

1.GameBasePanel脚本

在构造方法中,加入

messageManager=GameManager.Instance.messageManager;

if(uiPanelType==UIPanelType.DayNightPanel){isDayNightPanel=true;}

2.OnInitPanel方法

if(!isDayNightPanel){

openAnimCom,closeAnimCom,openEye,closeEye,certainButton获取

}

guideMessage,messageController,controller

3.public virtual void HandleGameAction(UIPanelType currentGamePanelType){}

4.public virtual void ToCurrentPanel()

{controller.selectedIndex=0;

messageController.selectedIndex=0;

openEye.visible=true;

closeEye.visible=false;

openEye.SetPlaySettings(1,16,1,1);

openEye.playing=true;

if(firstTimeInThisPanel)

{openEye.onPlayEnd.Add(()=>{controller.selectedIndex=1;messageController.selectedIndex=1;openEye.visible=false;})}

}

[展开全文]
lix0824 · 2018-08-06 · 0

GameBasePanel补充

AfterAction(UIPanelType nextPanel){

if(!isDayNightPanel){

controller.selectedIndex=3;

messageController.selectedIndex=3;}

else{

controller.selectedIndex=8;}

ToNextPanel(nextPanel);}

ToNextPanel(UIPanelType nextPanel){

if(!isDayNightPanel){

closeEye.visible=true;

if(firstTimeInThisPanel){

firstTimeInThisPanel=false;

closeEye.onPlayEnd.Add(()=>{ToOtherPanel(nextType);

closeEye.visibl=false;});}

closeEye.SetPlaySettings(1,9,1,9);

closeEye.Playing=true;}

else{

Transition ToNight=contentPane.GetTransition("ToNight");

ToNight.play(()=>{ToOtherPanel(nextType);});}}

[展开全文]
lix0824 · 2018-08-06 · 0

补充UIManager脚本

1.GameUIManager()

{isGameUIManager=true;

if(UIPanelDict.Count!=0){

ClearDict();}}

2.GamePanel文件夹添加脚本继承GameBasePanel

DayNigth,GuardPanel,Hunter,Prophet,Witch,Wolf;

[展开全文]
lix0824 · 2018-08-06 · 0

sin 是锐角的对边比斜边

cos 定义是 锐角的邻边比斜边

tan 直角三角形中,锐角对应对边比邻边

推导  Cos 45°

根据勾股定理   a² + b² = c²

斜边   c² =^a² + b²

如果两条边都为1 ,即斜边 ^2

为了计算简化 分母有理化,是针对分母有无理数或无理式的分式而言的,分母有理化也就是把分式的分母变成有理数或有理式的过程。

上下分别乘以根号2

^2/2  是  分母有理化的来

Cos 45° = ^2/2

[展开全文]
flashice2030 · 2018-07-28 · 0

将好几个物体合并mesh

获取子物体中的meshfilter组件

创建combineinstance组件

for循环赋予combineinstance

sharemesh,局部赚世界的矩阵坐标transform.localtoworldmatrix

创建一个mesh mesh.combinemeshs

 

[展开全文]
蝶花醉梦 · 2018-07-27 · 0

这节是贴图 然后可以加实时的阴影

[展开全文]
D大调卡农与吉格 · 2018-07-25 · 0

Directional Light 平行光

[展开全文]
D大调卡农与吉格 · 2018-07-25 · 0

AndroidJavaClass unityPlayer=new AndroidJavaClass("com.unity3d.player.UnityPlayer");

AndroidJavaObject currentActivity=unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");

 

AndroidJavaClass toast=new AndroidJavaClass("android.widget.Toast");

AndroidJavaObject context=currentActivity.Call<AndroidjavaObject>("getApplicationContext");

 

currentActivity.Call("runOnUiThread",new AndroidJavaRunnable(()=>{

tocsat.CallStatic<AndroidJavaObject>("makeText",context,"send...",tocast.GetStatic<int>("LENGTH_LONG")).Call("show");

}));

[展开全文]
786566316 · 2018-07-25 · 0

笛卡尔坐标系:

 1.笛卡尔直角坐标系

 2.笛卡尔斜角坐标系

 3.笛卡尔坐标系的度量单位一致

 4.第一象限++,第二象限-+,第三象限+-,第四--

 

[展开全文]
一只 · 2018-07-22 · 0

1.Game场景调整Camera设置

2.定义GameBasePanel脚本

protected GComponent openAnimCom,closeAnimCom,guideMessage,

GMovieClip openEye,closeEye

bool firstTimeInThisPanel,isDayNightPanel;

protected GameBasePanel nextPanel;

GameBasePanel SetNextPanel(GameBasePanel nextGamePanel){nextPanel=nextGamePanel;return nextPanel;}

protected Controller messageController,MessageManager messageManager,GButton certainButton;

[展开全文]
lix0824 · 2018-07-11 · 0

1.卡牌翻转效果Turn();

private void Turn()
    {
        if (DOTween.IsTweening(cardButton))
        {
            return;
        }
        toOpen = !toOpen;
        DOTween.To(() => 0, x => 
        {
            if (toOpen)
            {
                cardBack.rotationY = x;
                cardFront.rotationY = -180 + x;
                if (x > 90)
                {
                    cardBack.visible = true;
                    cardFront.visible = false;
                }
            }
            else
            {
                cardBack.rotationY = -180 + x;
                cardFront.rotationY =  x;
                if (x > 90)
                {
                    cardBack.visible = false;
                    cardFront.visible = true;
                }
            }
        }, 180, 0.5f).SetTarget(cardButton).SetEase(Ease.OutQuad);
    }

 

[展开全文]
lix0824 · 2018-06-28 · 0

GamePanel脚本

RotateCard方法完善

[展开全文]
lix0824 · 2018-06-28 · 0

1.GamePanel脚本内变量赋值。

2.ShuffleTheCard(){

int count=0;

while(count<12){

int r=Random.range(1,13);

for(int i=0;i<randomList.Length;i++){

if(randomList[i]==r){

isTheSame=true;

break;

}

}

if(!isTheSame){

randomList[count]=r;

count++;}

isTheSame=false;

}

}

3.定义RotateCard()方法

[展开全文]
lix0824 · 2018-06-26 · 0

1.定义GamePanel成员变量

transition star,loadAnim;GButton cardButton;GObject cardFront,cardBack;GComponent guideMessage;Controller messageController;GTextField tex_Number,tex_ID;bool toOpen=true;

2.1-4为狼,5-8为民,9预言家,10女巫,11猎人,12守卫

int[] RandomList=new in[12];bool isTheSame;int index,wolfIndex,villagersIndex

 

 

[展开全文]
lix0824 · 2018-06-25 · 0

HelpPanel脚本

1.ShowIDInformation(int id)函数

 

[展开全文]
lix0824 · 2018-06-21 · 0

MainPanel脚本重写OnInitPanel方法。

transition=contentPane.GetTransition("WhiteMaskAnim");

transition.Play();

Transition t=panelMask.GetTransition("MaskShow");

t.play();

contentPane.GetChild("Btn_StartGame").OnClick.Add(()=>{ToOtherPanel(UIPanelType.GamePanel);

GameManager.Instance.audioSourceManager.ChangeBGM(1);});

contentPane.GetChild("Btn_Help").OnClick.Add(()=>{ToOtherPanel(UIPanelType.HelpPanel);});

contentPane.GetChild("Btn_Set").OnClick.Add(()=>{ToOtherPanel(UIPanelType.SetPanel);});

contentPane.GetChild("Btn_ExitGame").OnClick.Add(()=>{Application.Quit();});

[展开全文]
lix0824 · 2018-06-20 · 0

BasePanel脚本 进入 退出 跳转功能

1.创建EnterPanel(){

Transition t=panelMask.GetTransition(“MaskShow”);

t.play();}

2.创建protected void ToOtherPanel(UIPanelType otherType){

ExitPanel(()=>{ChangePanelCallback(otherType)});}

3.创建Protected void ExitPanel(PlayCompleteCallback playCompleteCallback){

Transition t=panelMask.GetTransition(“MaskHide”);

t.play(playCompleteCallback);

}

4.protected void ChangePanelCallback(UIPanelType otherType){

uiManager.UIPanelDict[currentUIPanelType].Hide();

uiManager.UIPanelDict[otherType].Show();

uiManager.UIPanelDict[otherType].EnterPanel();

}

[展开全文]
lix0824 · 2018-06-19 · 0

1.UIManager函数定义

bool isGameUIManager;

UIPanelType currentGamePanel;

2.建立字典Dictionary<UIPanelType,BasePanel> UIPanelDict;

构造UIManager时,实例化UIPanelDict=new Dictionary<UIPanelType,BasePanel>();

3.当切换菜单场景和游戏场景时,需要清空字典

ClearDict(){

foreach(var item in UIPanelDict)

{

item.Value.Dispose();}

UIPanelDict.Clear();

}

4.创建GameUIManager和MainUIManager函数,

public void MainUIManager(){

isGameUIManager=false;

if(UIPanelDict.Count!=0){

ClearDict();}

UIPanelDict.Add(UIPanelType.MainPanel,newMainPanel("Panel_Main",UIPanelType.MainPanel,this));

UIPanelDict.Add(UIPanelType.GamePanel,new GamePanel("Panel_Game",UIPanelType.GamePanel,this));

UIPanelDict.Add(UIPanelType.HelpPanel,new HelpPanel("Panel_Help",UIPanelType.HelpPanel,this));

UIPanelDict.Add(UIPanelType.SetPanel,new SetPanel("Panel_Set",UIPanelType.SetPanel,this));

UIPanelDict[UIPanelType.MainPanel].Show();

}

5.GameManager构建UImanager时调用MainUIManager。

[展开全文]
lix0824 · 2018-06-19 · 0