// Start is called before the first frame update
    void Start()
    {
        infomanager        = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        infomanager.isTime = true;

        Debug.Log("생성합니다Right");
        createRightMonster();
        Invoke("createRightMonster", 1.0f);
        Invoke("createRightMonster", 2.0f);

        Debug.Log("생성합니다Left");
        Invoke("createLeftMonster", 7.0f);
        Invoke("createLeftMonster", 8.0f);
        Invoke("createLeftMonster", 9.0f);

        Invoke("createCenterMonster", 14.0f);
        Invoke("createCenterMonster", 15.0f);

        Invoke("createRightMonster", 18.0f);
        Invoke("createRightMonster", 19.0f);

        Invoke("createLeftMonster", 18.0f);
        Invoke("createLeftMonster", 19.0f);

        Invoke("createCenterMonster", 18.0f);
        Invoke("createCenterMonster", 19.0f);
    }
Beispiel #2
0
 private void Start()
 {
     gameInformationManager        = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
     gameInformationManager.isTime = true;
     gamemanager21_script          = GameManager.GetComponent <chapter21_gamemanager>();
     rb = GetComponent <Rigidbody>();
 }
    public void nextScene()
    {
        Inventory inven = GameObject.Find("inventorySystem").GetComponent <Inventory>();//현재 인벤토리 정보 가져옴
        gameInformationManager gameInformationManager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();


        for (int i = 0; i < 3; i++)
        {
            if (inven.slots[i].isEmpty == false) //퀵슬롯이 하나라도 차있으면
            {
                isQuickSlot = true;              //퀵슬롯에 아이템이 등록되어있다고 표ㅅ
                break;
            }
        }

        if (isQuickSlot == true)
        {
            // SceneManager.LoadScene("inventory");
            gameInformationManager.gotoNextScene();
        }

        else
        {
            Instantiate(cancelNext, GameObject.Find("CheckLocal").transform, false);//안내창 생cancelNext
        }
    }
Beispiel #4
0
    private void OnTriggerEnter(Collider other)//부딫히면
    {
        //유저 소유 아이템 블록체인에 업로드 코드 필요
        if (other.tag.Equals("Player"))                                             //플레이어 태그라면
        {
            Inventory inven = other.GetComponent <Inventory>();                     //현재 인벤토리 정보 가져옴

            for (int i = 0; i < inven.slots.Count; i++)                             //슬롯 개수만큼 반복문
            {
                if (inven.slots[i].isEmpty)                                         //비어있다면
                {
                    inven.slots[i].isEmpty = false;                                 //비어있는 상태 해제

                    Instantiate(slotItem, inven.slots[i].slotObj.transform, false); //슬롯에 슬롯 이미지 생성

                    break;
                }
            }

            Destroy(this.gameObject);//획득한 아이템 맵에서 제거

            gameInformationManager gameInformationManager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
            gameInformationManager.newGuns[gameInformationManager.gunCount] = this.name.Substring(6);
            gameInformationManager.gunCount++;
        }
    }
Beispiel #5
0
    void Start()
    {
        manager  = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        nickname = manager.nickName;

        Title_Nickname.GetComponent <Text>().text = nickname + "님 환영합니다";
    }
    private void Start()
    {
        portal.SetActive(false);
        ShowDialogue();

        infomanager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
    }
Beispiel #7
0
    void Start()
    {
        manager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        score   = manager.total_score;
        //점수 가져오기

        score_text.GetComponent <Text>().text = "점수 : " + score.ToString();
    }
    private void Start()
    {
        infomanager        = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        infomanager.isTime = true;

        dialogue_manager = GameObject.Find("DialogueManager").GetComponent <chapter1_2DialogueManager>();//최적화

        rb = GetComponent <Rigidbody>();
    }
    public void Start()
    {
        field_normal_riple.SetActive(false);


        monsterSpawn.SetActive(false);

        inven = Player.GetComponent <Inventory>();



        inven.slots[0].isEmpty = false;                                                                            //비어있는 상태 해제

        Instantiate(Resources.Load("prefabs/" + "image_normal_handgun"), inven.slots[0].slotObj.transform, false); //슬롯에 슬롯 이미지 생성

        ShowDialogue();



        gameInformationManager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
    }
Beispiel #10
0
    // Start is called before the first frame update
    private async void Start()//상점 입장 시 아이템 목록 각각 이미지 프리팹으로 불러와서 보여줌
    {
        infomanager  = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        userPassword = infomanager.passwd;
        infomanager.quickSlotItem.Clear();

        if (ItemOwnershipContractClient.GetAbi() == null)
        {
            Debug.Log("Error: no ABI file found");
            return;
        }

        playerWallet = LoadWallet(userPassword);
        var playerPrivateKey = playerWallet.privateKey;
        var playerPublicKey  = playerWallet.publicKey;

        Address ownershipContractAddress = Address.FromString(OwnershipContractAddress);

        this.OwnerClient = new ItemOwnershipContractClient(playerPrivateKey, playerPublicKey, ownershipContractAddress, Debug.unityLogger);

        await ConnectOwnerClient();

        GameObject slotPanel = GameObject.Find("inventorypanel");//캔버스에서 슬롯을 생성시킬 위치
    }
    public async Task LoadInventoryIteams()
    {
        ////인포매니저에서 비밀번호 받아옴
        infoManager  = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        userPassword = infoManager.passwd;

        if (ItemOwnershipContractClient.GetAbi() == null)
        {
            Debug.Log("Error: no ABI file found");
            return;
        }

        playerWallet = LoadWallet(userPassword);
        var playerPrivateKey = playerWallet.privateKey;
        var playerPublicKey  = playerWallet.publicKey;

        Address ownershipContractAddress = Address.FromString(OwnershipContractAddress);

        this.OwnerClient = new ItemOwnershipContractClient(playerPrivateKey, playerPublicKey, ownershipContractAddress, Debug.unityLogger);

        await ConnectOwnerClient();

        GameObject slotPanel = GameObject.Find("inventorypanel");//캔버스에서 슬롯을 생성시킬 위치
    }
Beispiel #12
0
 private void Start()
 {
     inven = GameObject.Find("inventorySystem").GetComponent <Inventory>();//현재 인벤토리 정보 가져옴
     gameInformationManager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
 }
Beispiel #13
0
 private void Start()
 {
     ShowDialogue();
     gameInformationManager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
 }
Beispiel #14
0
 // Start is called before the first frame update
 public void Awake()
 {
     gameInformationManager = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
 }
 private void Start()
 {
     gameInformationManager        = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
     gameInformationManager.isTime = true;
     rb = GetComponent <Rigidbody>();
 }
    async void Start()//상점 입장 시 아이템 목록 각각 이미지 프리팹으로 불러와서 보여줌
    {
        Instantiate(loading, GameObject.Find("PopUpLocation").transform, false);

        ////인포매니저에서 비밀번호 받아옴
        infoManager   = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();
        userPassword  = infoManager.passwd;
        newGunsInShop = infoManager.newGuns;



        text = GameObject.Find("Money").GetComponent <Text>();
        if (GameManagerContractClient.GetAbi() == null)
        {
            Debug.Log("Error: no ABI file found");
            return;
        }

        if (ItemFactoryContractClient.GetAbi() == null)
        {
            Debug.Log("Error: no ABI file found");
            return;
        }

        if (ItemOwnershipContractClient.GetAbi() == null)
        {
            Debug.Log("Error: no ABI file found");
            return;
        }

        playerWallet = LoadWallet(userPassword);
        var playerPrivateKey = playerWallet.privateKey;
        var playerPublicKey  = playerWallet.publicKey;

        Address factoryContractAddress   = Address.FromString(FactoryContractAddress);
        Address managerContractAddress   = Address.FromString(GameManagerContractAddress);
        Address ownershipContractAddress = Address.FromString(OwnershipContractAddress);

        this.FactoryClient = new ItemFactoryContractClient(playerPrivateKey, playerPublicKey, factoryContractAddress, Debug.unityLogger);
        this.OwnerClient   = new ItemOwnershipContractClient(playerPrivateKey, playerPublicKey, ownershipContractAddress, Debug.unityLogger);
        this.ManagerClient = new GameManagerContractClient(playerPrivateKey, playerPublicKey, managerContractAddress, Debug.unityLogger);


        await setUserWeapons();
        await ConnectFactoryClient();
        await ConnectManagerClient();

        slotPanel = GameObject.Find("useitempanel");//캔버스에서 슬롯을 생성시킬 위치
        int j = 0;

        foreach (JsonGunState.Gun g in this.getManagerGunState.guns)//이 슬롯들에 레이캐스트 입력 받는 컴포넌트 추가 - 선택하면 색 변하는 효과?(캔버스에 반투명 덮어씌우는 식으로?)
        {
            if (j < 10)
            {
                Debug.Log("Start Foreach  " + g.index);
                GameObject go = Instantiate(slotPrefab, slotPanel.transform, false);     //slotPrefab을 slotPanel위치에 생성
                prefabname[j] = g.name;
                priceString.GetComponent <Text>().text = g.price.ToString();
                itemName.GetComponent <Text>().text    = g.name;
                go.name = prefabname[j] + "/" + g.price; //생성된 슬롯의 이름
                SlotData slot = new SlotData();          //슬롯 객체 생성
                slot.isEmpty = true;                     //슬롯 객체 상태
                slot.slotObj = go;                       //슬롯 객체에 오브젝트 할당
                Instantiate(Resources.Load("prefabs/" + "image_" + prefabname[j]), go.transform, false);
                //현재 문자열 배열에 해당되는 오브젝트명 앞에 image를 붙여 해당 오브젝트의 이미지를 슬롯에 생성
                Instantiate(priceString, go.transform, false);
                Instantiate(itemName, go.transform, false);
                slots.Add(slot);//슬롯 추가
                j++;
            }
            else
            {
                break;
            }
        }

        money = this.tokenBalance;
        text.GetComponent <Text>().text = "보유금액:" + money;

        Destroy(GameObject.Find("Loading(Clone)").gameObject);
    }
    private async void Start()
    {
        gameInformationManager manager_logic = GameObject.Find("GameInformationManager").GetComponent <gameInformationManager>();

        MyScore_nicknamd.GetComponent <Text>().text = manager_logic.nickName;
        password = manager_logic.passwd;

        manager_logic.sceneNum = 0;

        PlayerWallet = LoadWallet(this.password);

        RankClient = new RankContractClient(
            RegisterWallet.privateKey,
            RegisterWallet.publicKey,
            Address.FromString(RankContractAddress),
            Debug.unityLogger);


        if (manager_logic.total_score == 0)
        {
            //타이틀에서 넘어오고
            uint myTopScore = await getTopScore();

            uint myRank = await getRanking();
            await getTop100RankPlayer();

            MyScore_score.GetComponent <Text>().text = myTopScore.ToString();
            if (myTopScore == 0)
            {
                MyScore_rank.GetComponent <Text>().text = "unrank";
            }
            else
            {
                MyScore_rank.GetComponent <Text>().text = myRank.ToString();
            }
        }
        else
        {
            uint totalScore = (uint)manager_logic.total_score;
            await GameEnd(totalScore, manager_logic.nickName);
            await getTop100RankPlayer();

            uint myRank = await getRanking();

            MyScore_rank.GetComponent <Text>().text = myRank.ToString();

            totalScore = await getTotalScore();

            MyScore_score.GetComponent <Text>().text = totalScore.ToString();
        }

        //여기서 부터 로컬 테스트
        JsonRankState.Rank testRanker2;
        testRanker2.nickname = "test2";
        testRanker2.score    = 600;

        JsonRankState.Rank testRanker3;
        testRanker3.nickname = "test1";
        testRanker3.score    = 450;

        jsonRankState.Ranks.Add(testRanker2);
        jsonRankState.Ranks.Add(testRanker3);

        GameObject slotPanel = GameObject.Find("User_List");

        maxSlot = jsonRankState.Ranks.Count;

        foreach (JsonRankState.Rank rank in jsonRankState.Ranks)
        {
            GameObject go = Instantiate(userList_Slot, slotPanel.transform, false);
            go.transform.GetChild(0).GetComponent <Text>().text = (jsonRankState.Ranks.IndexOf(rank) + 1).ToString();
            go.transform.GetChild(1).GetComponent <Text>().text = rank.nickname;         //닉네임
            go.transform.GetChild(2).GetComponent <Text>().text = rank.score.ToString(); //점수
        }
    }