/// <summary>Sync the values of the Item and Original Object if they have the Material & Mesh Changer </summary>
        protected virtual void Sync_Material_ActiveMeshes()
        {
            if (Last_SpawnedItem)
            {
                MaterialChanger OriginalMC = Last_SpawnedItem.GetComponent <MaterialChanger>();
                MaterialChanger ItemSelMC  = ItemSelected.GetComponent <MaterialChanger>();

                if (OriginalMC && ItemSelMC)
                {
                    for (int i = 0; i < ItemSelMC.materialList.Count; i++)
                    {
                        OriginalMC.SetMaterial(i, ItemSelMC.CurrentMaterialIndex(i)); //Set the Materials from the Item to the Original
                    }
                }

                ActiveMeshes OriginalAM = Last_SpawnedItem.GetComponent <ActiveMeshes>();
                ActiveMeshes ItemSelAM  = ItemSelected.GetComponent <ActiveMeshes>();

                if (OriginalAM && ItemSelAM)
                {
                    for (int i = 0; i < ItemSelAM.Count; i++)
                    {
                        OriginalAM.ChangeMesh(i, ItemSelAM.GetActiveMesh(i).Current); //Set the Meshes from the Item to the Original
                    }
                }
            }
        }
Exemple #2
0
    private void Init()
    {
        material.SetMaterial(0, nowPlayer.skin);
        mesh.ChangeMesh(0, nowPlayer.antler);
        mesh.ChangeMesh(2, nowPlayer.spot);
        mesh.ChangeMesh(1, 1);
        animal.Shift = true;
        string[] PosStr   = nowPlayer.startPosition.Split('#');
        Vector3  startPos = new Vector3(float.Parse(PosStr[0]), float.Parse(PosStr[1]), float.Parse(PosStr[2]));

        transform.position           = startPos;
        antlerMagic.transform.parent = tsAntler[nowPlayer.antler - 1];
        antlerMagic.gameObject.SetActive(false);
        step = GetComponentsInChildren <StepTrigger>();
        if (step != null)
        {
            for (int i = 0; i < step.Length; i++)
            {
                step[i].volume = DataManager.Instance.GetSettingData().effectVolume;
            }
        }
    }
Exemple #3
0
    private void BtnClick(Button button)
    {
        switch (button.name)
        {
        case "btnAdd":
            UIManager.Instance.PushPanel(Panel_ID.CreatePlayerPanel, cellIndex);
            break;

        case "btnDelete":
            UIManager.Instance.CreateConfirmPanel("你要删除这个存档吗?", delegate(object obj1)
            {
                UIManager.Instance.PopPanel();
                UIManager.Instance.CreateConfirmPanel("真的要删除这个存档吗", delegate(object obj2)
                {
                    UIManager.Instance.PopPanel();
                    UIManager.Instance.CreateConfirmPanel("删除了这个存档就不能还原了!", delegate(object obj3)
                    {
                        UIManager.Instance.PopPanel();
                        UIManager.Instance.CreateConfirmPanel("那好吧再见!", delegate(object obj4)
                        {
                            player.open = false;
                            DataManager.Instance.Save(player);
                            UIManager.Instance.PopPanel();
                        });
                    });
                });
            });
            break;

        case "btnGo":
            UIManager.Instance.CreateConfirmPanel("用这个角色开始游戏?", GoGame, null, OnCancel);
            material.SetMaterial(0, player.skin);
            mesh.ChangeMesh(0, player.antler);
            mesh.ChangeMesh(2, player.spot);
            GameRoot.Instance.evt.CallEvent(GameEventDefine.MOVE_CAMERA, 0);
            break;
        }
    }
Exemple #4
0
 private void OnAntlerChanged(int index)
 {
     mesh.ChangeMesh(0, index);
 }