Exemplo n.º 1
0
    public PlayerGameData(GameData gameData)
    {
        _gameData = gameData;

        PlayerStats = new PlayerStatsGameData();
        SlavesOwned = new List<Slave>();
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        activeState = new BeginState(this);
        Debug.Log("This object is of type: " + activeState);

        gameDataRef=GetComponent<GameData>();
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        m_GameData = GameData.Instance;

        m_StreamPath = Environment.GetFolderPath (Environment.SpecialFolder.Desktop);
        m_StreamPath += "/ImagineNation_Recorded_Data";

        if (!Directory.Exists (m_StreamPath))
            Directory.CreateDirectory (m_StreamPath);

        switch (m_GameData.CurrentSection)
        {
            case Sections.Sections_1:
            m_StreamPath = m_StreamPath + "/SectionOne_PositionData";
            break;

            case Sections.Sections_2:
            m_StreamPath = m_StreamPath + "/SectionTwo_PositionData";
            break;

            case Sections.Sections_3:
            m_StreamPath = m_StreamPath + "/SectionThree_PositionData";
            break;
        }
        CheckIfFileExists ();
    }
Exemplo n.º 4
0
	public static GameData Instance ()
	{
		if (g_Instance == null) {
			g_Instance = new GameData ();
		}
		return g_Instance;
	}
Exemplo n.º 5
0
    //Controlla e se necessario riserializza i percorsi
    public static void SerializzaPercorsi(ref GameData databseInizialeAmicizie, ref Serializzabile<AmicizieSerializzabili> datiDiplomazia, ref Dictionary<string, int> dizionarioPercorsi)
    {
        //Controlla i percorsi se sono gia serializzati e se ci sono variazioni li reserializza
        //se non sono serializzati li serializza
        //se non ci sono variazioni non fa niente

        if (databseInizialeAmicizie == null) return;

        if (datiDiplomazia == null)

            datiDiplomazia = new Serializzabile<AmicizieSerializzabili>(Statici.nomeFileDiplomazia);

        if (datiDiplomazia.Dati.indexPercorsi.Equals(databseInizialeAmicizie.indexPercorsi)) return;  //CONTROLLARE SE METODO E' CORRETTO

        for (int i = 0; i < databseInizialeAmicizie.classiEssere.Length; i++)

        {
            datiDiplomazia.Dati.indexPercorsi[i] = databseInizialeAmicizie.indexPercorsi[i];
        }

        datiDiplomazia.Salva();

        // AGGIUNTO PER IL DIZIONARIO SUI PERCORSO
        dizionarioPercorsi.Clear();

        for (int i = 0; i < datiDiplomazia.Dati.tipoEssere.Length; i++)
            dizionarioPercorsi.Add(datiDiplomazia.Dati.tipoEssere[i], datiDiplomazia.Dati.indexPercorsi[i]);
    }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        if(instance == null){
            DontDestroyOnLoad(this);
            instance = this;
        } else if(instance != this){
            DestroyImmediate(this.gameObject);
        }

        //		string path = Application.persistentDataPath + "/TwoPlayerGames.dat";
        //		Debug.Log("Path: " + path);
        //
        //		players = new PlayerProfile[2];
        //
        //		Debug.Log("Start");
        //
        //		player = new PlayerProfile();
        //		player.name = "Mario Pinto";
        //		player.age = 26;
        //		player.preferedColor = Color.cyan;
        //		player.sex = 1;
        //		player.hasPhoto = false;
        //
        //		Debug.Log(player.ToString());
        //
        //		SaveData();

        LoadData();
    }
 private void CheckStatus()
 {
     if (this.gameData == null)
     {
         this.gameData = GameData.instance;
     }
     if (this.gameGlobalConfig == null)
     {
         this.gameGlobalConfig = GameConfigs.instance.GlobalConfig;
     }
     if (this.gameData.UserInfo != null)
     {
         long[] resourceRecoveryTimes = this.gameData.UserInfo.resourceRecoveryTimes;
         long nowServerTime = ServerTimer.GetNowServerTime();
         int[] resourceRecoveryTime = this.gameGlobalConfig.resourceRecoveryTime;
         int[] resourceRecoveryNum = this.gameGlobalConfig.resourceRecoveryNum;
         int[] nums = new int[4];
         for (int i = 0; i < 4; i++)
         {
             if (((resourceRecoveryTimes.Length > i) && (resourceRecoveryTime.Length > i)) && ((resourceRecoveryNum.Length > i) && ((nowServerTime - resourceRecoveryTimes[i]) > resourceRecoveryTime[i])))
             {
                 nums[i] = resourceRecoveryNum[i];
                 resourceRecoveryTimes[i] = nowServerTime;
             }
         }
         this.gameData.UserInfo.AddAutoProducedResources(nums);
         this.OnResourceUpdateEvent(EventArgs.Empty);
     }
 }
Exemplo n.º 8
0
    public void UpdateUI(bool isWin, GameData gameData)
    {
        score.text = gameData.Score.ToString();
        bestScore.text = gameData.HighScore.ToString();
        if (isWin)
        {
            best.SetActive(false);
            currentScore.SetActive(false);
            WinText.text = "YOU WIN !";
			loseImage.enabled = false;
            AddFlare();
            SoundManager.instance.PlayingSound("Win", 1, Camera.main.transform.position);
        }
        else
        {
            SoundManager.instance.PlayingSound ("Lose", 1, Camera.main.transform.position);
        }

        if(gameData.isHighScore)
        {
            NewHighScoreText.SetActive(true);
            AddFlare();
        }
        else
        {
            NewHighScoreText.SetActive(false);
        }
    }
Exemplo n.º 9
0
    void Start()
    {
        gameData = GameLogic.Instance.gameData;
        upgradeData = GameLogic.Instance.upgradeData;

        connectShopItemInfos();
    }
Exemplo n.º 10
0
 public MetricUnits(Field field, GameData data, int[] randSequence)
 {
     _field = field;
     _gameData = data;
     _randSequence = randSequence;
     CalcCommonMetrics();
 }
        public override void StartController()
        {
            Application.targetFrameRate = 30;
            this.gameData=this.GetManager ().GetComponent<GameData>();
            if (this.gameData == null) {
                throw new UnassignedReferenceException("Obiekt "+this.GetManager().gameObject.name+" nie ma komponentu GameData");
            }
            this.guiAssets = this.GetManager ().GetComponent<GuiStatesAssets> ();
            if (this.guiAssets == null) {
                throw new UnassignedReferenceException("Obiekt "+this.GetManager().gameObject.name+" nie ma komponentu GuiStatesAssets");
            }
            /**
             * zliczamy włączenia gry
             */
            this.GetData ().countGames = PlayerPrefs.GetInt ("CountGames");
            this.GetData ().countGames++;
            PlayerPrefs.SetInt ("CountGames",this.GetData ().countGames);
            PlayerPrefs.Save();

            adMob = new AdMob ();
            adMob.StartBanner ();

            this.ChangeState(new States.MainMenuState());
            GameCenter.Authenticate();
        }
    private void Start()
    {
        this.gameData = GameData.instance;
        bool flag = false;
        if ((this.activeWhenInEvent == null) || (this.activeWhenInEvent.Length == 0))
        {
            this.targetObj.SetActive(false);
        }
        else
        {
            foreach (MarketingEvents events in this.activeWhenInEvent)
            {
                if (flag)
                {
                    break;
                }
                switch (events)
                {
                    case MarketingEvents.BuildEvent:
                        flag = this.gameData.MarketingDatas.isHasBuildEvent == 1;
                        break;

                    case MarketingEvents.PVEExpEvent:
                        flag = this.gameData.MarketingDatas.isHasPVEEXPEvent == 1;
                        break;

                    case MarketingEvents.PVEExploreEvent:
                        flag = this.gameData.MarketingDatas.isHasPVEExploreEvent == 1;
                        break;
                }
            }
        }
        this.targetObj.SetActive(flag);
    }
Exemplo n.º 13
0
 /// <summary>
 /// Tries to delete the character associated with the object.
 /// The Gameobject passed in should have a RMCharacterUnit component attached to it.
 /// </summary>
 /// <param name="obj"></param>
 public void TryDeleteCharacter(GameData data)
 {
     _targetDeleteGameData = data;
     _descriptionText.text = string.Format(_descriptionTextBaseCached, _targetDeleteGameData.PlayerData.PlayerName);
     // Finally show the window
     UIWindow.GetWindowByCustomID(1).Show();
 }
	void Start()
	{
		//starts BeginState, sets it to active state
		//passes this script - statemanager - to BeginState so it can use it as reference
		activeState = new BeginState(this);
		gameDataRef = GetComponent<GameData>();
	}
    private GameData ProcessAllocRoom(GameData data)
    {
        if (data.returnCode == ReturnCode.Success)//如果分配成功
        {
            try
            {
                //赋值给全局
                AllocRoomData roomInfoData = JsonCoding<AllocRoomData>.decode(data.operateData);
                Global.Instance.playerRoomData = roomInfoData;
                if (GameClient.Instance.GetGameSceneManager() != null)
                {
                    GameClient.Instance.GetGameSceneManager().gameManager.UpdateGameInfo();
                }

                LogsSystem.Instance.Print("已经分配到房间号:" + roomInfoData.roomID + ",正在载入游戏");

                //载入游戏界面
                Application.LoadLevel("GameScene");
            }
            catch (Exception ex)
            {
                LogsSystem.Instance.Print("分配房间失败:" + ex.ToString(), LogLevel.ERROR);
            }
        }
        else
        {
            LogsSystem.Instance.Print("返回数据为不成功");
        }

        return null;
    }
Exemplo n.º 16
0
 private void AdventureLoadout(GameData data)
 {
     data.PlayerData.UnlockedElements[0] = Element.Fire;
     data.PlayerData.UnlockedElements[1] = Element.Water;
     data.PlayerData.UnlockedElements[2] = Element.Air;
     data.PlayerData.UnlockedElements[3] = Element.Earth;
 }
Exemplo n.º 17
0
        public MainForm()
        {
            InitializeComponent();

            this.currentFileData = new GameData(32, 32);
            this.currentFileName = null;

            this.toolImages = new TextureBrush[7];

            for (int i = 0; i < this.toolImages.Length; i++)
            {
                this.toolImages[i] = new TextureBrush(Image.FromFile("images/" + i + ".png"));
            }

            this.backgroundImage = new TextureBrush(Image.FromFile("images/checkerboard.png"));

            this.selectedTool = 1;

            this.graphicsContext = BufferedGraphicsManager.Current;
            this.graphics = graphicsContext.Allocate(this.StageEditBoard.CreateGraphics(),
                new Rectangle(0, 0, 32 * (int)EDIT_BOARD_SCALING, 32 * (int)EDIT_BOARD_SCALING));

            for(int i = 0; i < MainForm.DIRECTIONS.Length; i++)
                this.StartDirection.Items.Add(DIRECTIONS[i]);

            this.LoadTextureFiles();

            this.FileNew(null, null);
        }
Exemplo n.º 18
0
	void Awake () {
		// インスタンスが存在するなら破棄する
		if (existsInstance)
		{
			Destroy(gameObject);
			return;
		}

		instance = this;
		existsInstance = true;
		DontDestroyOnLoad(gameObject);
		{
			var textAsset = Resources.Load ("GameData") as TextAsset;
			var data = MiniJSON.Json.Deserialize (textAsset.text) as Dictionary<string, object>;

			gameData = new GameData (data);
		}
		{
			var textAsset = Resources.Load ("BuddhistName") as TextAsset;
			var data = MiniJSON.Json.Deserialize (textAsset.text) as Dictionary<string, object>;
			MainSystem.Instance.buddhistNames = new BuddhistNames (data);
		}
		{
			var textAsset = Resources.Load ("Sokumibotoke") as TextAsset;
			var data = MiniJSON.Json.Deserialize (textAsset.text) as Dictionary<string, object>;
			MainSystem.Instance.sokumibotokeInfo = new Sokumibotoke (data);
		}
	}
Exemplo n.º 19
0
	// Use this for initialization
	void Awake () {
		game = this;
		for (int i = 0; i < categories.Length; i++) {
			categoryLists.Add (categories [i], new List<int> ());
		}

		recipeList = JSON.Parse((Resources.Load("recipes") as TextAsset).text)["recipes"];

		for (int i = 0; i < recipeList.Count; i++) {
			categoryLists[recipeList [i] ["category"].Value].Add(i);
		}
		/*
		for (int i = 0; i < recipeList.Count; i++) {
			itemUnlock [i] = 1;
		}*/
		if (File.Exists (Application.persistentDataPath + "/savedData.json")) {
			Load ();
		}
		else{
			setInitData ();
		}


		if (discovered < levelOneCriteria) {
			currentCircle = Instantiate (circleThree);
		}
		else if (discovered < levelTwoCriteria) {
			currentCircle = Instantiate (circleFour);
		} else {
			currentCircle = Instantiate (circleFive);
		}
	}
Exemplo n.º 20
0
    public void SetUp(GameData.QuestData data, int questNumber)
    {
        gameObject.SetActive(true);
        requirementsListView.Clear();

        GameData.BuildingData building = GameData.instance.GetBuildingData(data.builds);
        GameData.CharacterData character = GameData.instance.GetCharacterData(data.questGiver);
        this.questNumber = questNumber;
        questData = data;
        title.text = building.name;
        questGiverName.text = character.name;
        questGiverSprite.sprite = character.defaultSprite;
        questGiverSprite.SetNativeSize();
        flavorText.text = data.description;

        bool requirementsMet = true;
        foreach (var key in data.requirements.Keys) {
            string resource = key;
            int required = data.requirements[key];
            int obtained = GameState.instance.resources[resource];
            requirementsListView.Add(resource, required, obtained);
            if (required > obtained) {
                requirementsMet = false;
            }
        }
        buildButton.interactable = requirementsMet;
    }
Exemplo n.º 21
0
	// Use this for initialization
	void Start()
	{
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        _gameData = new GameData();

        startGameUI.SetActive(true);
		endGameUI.SetActive(false);
		parachute = GameObject.FindGameObjectWithTag("Parachute");
		parachuteController = parachute.GetComponent<ParachuteController>();
		player = GameObject.FindGameObjectWithTag("Pilot");
		playerController = player.GetComponent<PlayerController>();
		playerController.enabled = false;

		Physics2D.gravity = new Vector2(0, 0);

		originPlayerPosition = player.transform.position;
		originParachutePosition = parachute.transform.position;

		trankControllers = level.GetComponentsInChildren<TankCotroller>();

		playerGameObject.SetActive(false);

		SoundManager.instance.startBGM();
       
//        AdMob.requestInterstital( "ca-app-pub-1215085077559999/3564479460", "ca-app-pub-1215085077559999/5180813465" );
//        AdMob.init( "ca-app-pub-1215085077559999/3044727060", "ca-app-pub-1215085077559999/6187409461" );

        gameUIController.UpdateUI(gameData);
    }
Exemplo n.º 22
0
Arquivo: PG_Bot.cs Projeto: bdjnk/Demo
    private void Start()
    {
        gameData = GameObject.FindGameObjectWithTag("Master").GetComponent<GameData>();
        SetColor("Red");

        if (transform.position.x > gameData.extent.x)
        {
            farOut = transform.position.x - gameData.extent.x;
        }
        else if (transform.position.x < 0)
        {
            farOut = -transform.position.x;
        }
        else // within the extent of the map
        {
            if (transform.position.z > gameData.extent.z)
            {
                farOut = transform.position.z - gameData.extent.z;
            }
            else if (transform.position.z < 0)
            {
                farOut = -transform.position.z;
            }
        }
    }
Exemplo n.º 23
0
    public void Reinicializar()
    {
        gameData = new GameData();
        //gameData = new GameData(DataCenter.levels[0].jogos[10]);
        print(gameData.JogoAtual);
        print("Dica 1 " + gameData.Dica(1));
        //yield return new WaitForSeconds(2);

        ReligarBotao();
        imagemJogo.GetComponent<UITexture>().mainTexture = gameData.ImagemDoJogo();

        foreach (GameObject b in botoes)
        {
            b.GetComponentInChildren<UILabel>().text = "";
        }

        for (int i = 0; i < botoes.Length; i++)
        {
            botoes[i].GetComponentInChildren<UILabel>().text = gameData.LetrasBotoes[i].ToString();
            //botoes[i].GetComponentInChildren<UILabel>().ProcessText();
            //print("Texto label: " + i + " " + botoes[i].GetComponentInChildren<UILabel>().text);
            botoes[i].GetComponent<ButtonPress>().indice = i;
           //yield return new WaitForSeconds(0.1f);
        }
        for (int i = 0; i < botoes.Length; i++)
        {
            botoes[i].GetComponentInChildren<UILabel>().text = gameData.LetrasBotoes[i].ToString();
            //print("Texto label: " + i + " " + botoes[i].GetComponentInChildren<UILabel>().text);
            botoes[i].GetComponent<ButtonPress>().indice = i;
            //yield return new WaitForSeconds(0.1f);
        }
    }
Exemplo n.º 24
0
    public void Save()
    {

        Debug.Log("Saving");

        BinaryFormatter bf = new BinaryFormatter();
        FileStream file = File.Create(Application.persistentDataPath + "/BBgameData1.dat");
        GameData data = new GameData();

        //assign data fields here

        data.gatLevel_damage = Upgrades.instance.gatLevel_damage;
        data.gatLevel_fireRate = Upgrades.instance.gatLevel_fireRate;
        data.laserLevel_damage = Upgrades.instance.laserLevel_damage;
        data.laserLevel_fireRate = Upgrades.instance.laserLevel_fireRate;
        data.shotGunLevel_damage = Upgrades.instance.shotGunLevel_damage;
        data.shotGunLevel_fireRate = Upgrades.instance.shotGunLevel_fireRate;
        data.rocketLevel_damage = Upgrades.instance.rocketLevel_damage;
        data.rocketLevel_fireRate = Upgrades.instance.rocketLevel_fireRate;

        data.parts = Upgrades.instance.parts;
        data.cores = Upgrades.instance.cores;

        data.lGun = (int)Equipment.instance.leftGun;
        data.rGun = (int)Equipment.instance.rightGun;
        data.body = (int)Equipment.instance.body;
        data.head = (int)Equipment.instance.head;

        bf.Serialize(file, data);
        file.Close();

        Debug.Log("Saving Done");


    }
    public static void NewGame()
    {
        auto = false;
        data = new GameData();
        enemyController = new EnemyController();
        ILevelBuilder generator = new LevelGenerator();

        data.level = generator.Generate();
        for (int i = 0; i < data.level.doors.Count; i++)
        {
            data.level.doors[i].Init();
        }

        data.SpawnPlayer();
        //DEBUG STUFF
        //data.inventory.Add(ItemLibrary.Get().items[5], 1);

        foreach (IGameDataChangeListener listener in GAMEDATA_CHANGE_LISTENERS)
        {
            listener.OnGameDataChange(data);
        }

        //ConsolePseudoRaycast.CastRay(new Vector2(14, 1), new Vector2(16, 3));
        //Console.ReadKey();
    }
Exemplo n.º 26
0
	void Start()
	{
		data = MainSystem.Instance.gameData;

		nowType = StateType.human;
		SetTexture (nowType);

		SetData ();

		GUIController.Instance.SetCoolTime (data.StomacCoolTime, data.TrainingCoolTime, data.PreachingCoolTime);

		GUIController.Instance.OnButtonDownStomac = () => {
			Stomac += data.GainStomacValue * (1 - Hotoke * 0.005f);
		};
		GUIController.Instance.OnButtonDownTreaning = () => {
			Hotoke += data.GainHotokeValue;
			hide = true;
		};
		GUIController.Instance.OnButtonDownPreaching = () => {
			Faith += data.GainFaithValue * (1 + Hotoke * 0.01f);
			hide = true;
		};

		GUIController.Instance.OnCoolFinish = () => {
			hide = false;
		};
	}
Exemplo n.º 27
0
        public GameFile(string overworld, int id)
        {
            Data = new GameData
            {
                Metadata =
                {
                    OverworldFile = overworld,
                    WorldOrigin = PlayState.WorldOrigin,
                    WorldScale = PlayState.WorldScale,
                    TimeOfDay = PlayState.Sky.TimeOfDay,
                    ChunkHeight = PlayState.ChunkHeight,
                    ChunkWidth = PlayState.ChunkWidth,
                    GameID = id
                },
                Camera = PlayState.Camera,
                Components = PlayState.ComponentManager,
                ChunkData = new List<ChunkFile>(),
                GameID = id
            };

            foreach(ChunkFile file in PlayState.ChunkManager.ChunkData.ChunkMap.Select(pair => new ChunkFile(pair.Value)))
            {
                Data.ChunkData.Add(file);
            }
        }
Exemplo n.º 28
0
 public async Task Create(Game game)
 {
     using (var client = new HttpClient())
     {
         var data = new GameData() { Id = Guid.NewGuid(), IP = "127.0.0.1", Port = 1337, Name = "Hello World Game" };
         var response = await client.PostAsync(URL, data, new JsonMediaTypeFormatter());
     }
 }
Exemplo n.º 29
0
 void Start()
 {
     energia = energiaP;
     valorIntento = valorIntentoP;
     valorAyuda = valorAyudaP;
     gameDataRef = GetComponent<GameData>();
     estadoActivo = new StateLogin (this);
 }
Exemplo n.º 30
0
 void Awake()
 {
     gameData = GameObject.FindGameObjectWithTag("GameController");
     agent = GetComponent<NavMeshAgent>();
     data = gameData.GetComponent<GameData>();
     hash = gameData.GetComponent<HashIDs>();
     lightLevels = GameObject.FindGameObjectWithTag("LightLevels").GetComponent<LightLevels>();
 }
Exemplo n.º 31
0
    public void OnClickElementBt(int index)
    {
        if (GameData.ElementBoxList[index].bricks != 0)
        {
            if (GameData.getMoney() < GameData.ElementBoxList[index].bricks)
            {
                BoxPanel.transform.FindChild("DealBt").GetComponent <Button>().interactable = false; BoxPanel.transform.FindChild("DealBt").transform.FindChild("Text").GetComponent <Text>().text = "브릭스 부족";
            }
            else
            {
                GameData.soltElement();
                if (GameData.ElementInventory[GameData.getElementInventorySize() - 1].NodeType == NodeType.Empty)
                {
                    BoxPanel.transform.FindChild("DealBt").GetComponent <Button>().interactable = true;
                    BoxPanel.transform.FindChild("DealBt").transform.FindChild("Text").GetComponent <Text>().text = "구매하기";
                }
                else
                {
                    BoxPanel.transform.FindChild("DealBt").GetComponent <Button>().interactable = false;
                    BoxPanel.transform.FindChild("DealBt").transform.FindChild("Text").GetComponent <Text>().text = "인벤토리 초과";
                }
            }
            isEmerald = false;
        }
        else
        {
            if (GameData.getEmerald() < GameData.ElementBoxList[index].emerald)
            {
                BoxPanel.transform.FindChild("DealBt").GetComponent <Button>().interactable = false; BoxPanel.transform.FindChild("DealBt").transform.FindChild("Text").GetComponent <Text>().text = "에메랄드 부족";
            }
            else
            {
                BoxPanel.transform.FindChild("DealBt").GetComponent <Button>().interactable = true;
                BoxPanel.transform.FindChild("DealBt").transform.FindChild("Text").GetComponent <Text>().text = "구매하기";
            }
            isEmerald = true;
        }

        BoxPanel.SetActive(true);

        string[] getData = GameData.ElementBoxList[index].reword.Split('_');

        for (int i = 0; i < 5; i++)
        {
            if (i < getData.Length)
            {
                BoxPanel.transform.FindChild("elements").GetChild(i).gameObject.SetActive(true);
                string[] tmp = getData[i].Split('|');

                if (tmp[0].Equals("El"))
                {
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Image").GetComponent <Image>().sprite =
                        Resources.Load <Sprite>("Element/" + GameData.ElementList[int.Parse(tmp[1])].id);
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text =
                        "" + GameData.ElementList[int.Parse(tmp[1])].name;
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().color = new Color32(199, 183, 171, 255);
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text =
                        "" + int.Parse(tmp[2]);
                }
                else if (tmp[0].Equals("RAN"))
                {
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Image").GetComponent <Image>().sprite =
                        Resources.LoadAll <Sprite>("char/random")[int.Parse(tmp[1])];

                    if (int.Parse(tmp[1]) == 0)
                    {
                        BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text = "초급 랜덤재료";
                    }
                    else if (int.Parse(tmp[1]) == 1)
                    {
                        BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text = "중급 랜덤재료";
                    }
                    else if (int.Parse(tmp[1]) == 2)
                    {
                        BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text = "고급 랜덤재료";
                    }
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().color = new Color32(255, 255, 255, 255);
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text =
                        "" + int.Parse(tmp[2]);
                }
                else if (tmp[0].Equals("DO"))
                {
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Image").GetComponent <Image>().sprite =
                        Resources.LoadAll <Sprite>("char/do")[int.Parse(tmp[1])];

                    if (int.Parse(tmp[1]) == 0)
                    {
                        BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text = "★ ~ ★★★";
                    }
                    else if (int.Parse(tmp[1]) == 1)
                    {
                        BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text = "★★★ ~ ★★★★★";
                    }

                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().color = new Color32(255, 241, 0, 255);
                    BoxPanel.transform.FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text =
                        "";
                }
            }
            else
            {
                BoxPanel.transform.FindChild("elements").GetChild(i).gameObject.SetActive(false);
            }
        }
        BoxIndex = index;
        BoxPanel.transform.FindChild("Image").GetComponent <Image>().sprite = Resources.LoadAll <Sprite>("char/elebox")[index];

        if (!isEmerald)
        {
            BoxPanel.transform.FindChild("Cost").GetComponent <Text>().color = new Color32(254, 204, 0, 255);
            BoxPanel.transform.FindChild("Cost").GetComponent <Text>().text  = GameData.ElementBoxList[index].bricks + "B로 " + GameData.ElementBoxList[index].name + "를 구매하시겠습니까?";
        }
        else
        {
            BoxPanel.transform.FindChild("Cost").GetComponent <Text>().color = new Color32(129, 242, 0, 255);
            BoxPanel.transform.FindChild("Cost").GetComponent <Text>().text  = "에메랄드 " + GameData.ElementBoxList[index].emerald + "개로 " + GameData.ElementBoxList[index].name + "를 구매하시겠습니까?";
        }
    }
Exemplo n.º 32
0
        public override void PopulateData(RowParser parser, GameData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            EventHandler = parser.ReadColumn <ushort>(0);
            Important    = parser.ReadColumn <bool>(1);
            ENpcData     = new uint[32];
            for (var i = 0; i < 32; i++)
            {
                ENpcData[i] = parser.ReadColumn <uint>(2 + i);
            }
            Scale              = parser.ReadColumn <float>(34);
            ModelChara         = new LazyRow <ModelChara>(gameData, parser.ReadColumn <ushort>(35), language);
            Race               = new LazyRow <Race>(gameData, parser.ReadColumn <byte>(36), language);
            Gender             = parser.ReadColumn <byte>(37);
            BodyType           = parser.ReadColumn <byte>(38);
            Height             = parser.ReadColumn <byte>(39);
            Tribe              = new LazyRow <Tribe>(gameData, parser.ReadColumn <byte>(40), language);
            Face               = parser.ReadColumn <byte>(41);
            HairStyle          = parser.ReadColumn <byte>(42);
            HairHighlight      = parser.ReadColumn <byte>(43);
            SkinColor          = parser.ReadColumn <byte>(44);
            EyeHeterochromia   = parser.ReadColumn <byte>(45);
            HairColor          = parser.ReadColumn <byte>(46);
            HairHighlightColor = parser.ReadColumn <byte>(47);
            FacialFeature      = parser.ReadColumn <byte>(48);
            FacialFeatureColor = parser.ReadColumn <byte>(49);
            Eyebrows           = parser.ReadColumn <byte>(50);
            EyeColor           = parser.ReadColumn <byte>(51);
            EyeShape           = parser.ReadColumn <byte>(52);
            Nose               = parser.ReadColumn <byte>(53);
            Jaw                 = parser.ReadColumn <byte>(54);
            Mouth               = parser.ReadColumn <byte>(55);
            LipColor            = parser.ReadColumn <byte>(56);
            BustOrTone1         = parser.ReadColumn <byte>(57);
            ExtraFeature1       = parser.ReadColumn <byte>(58);
            ExtraFeature2OrBust = parser.ReadColumn <byte>(59);
            FacePaint           = parser.ReadColumn <byte>(60);
            FacePaintColor      = parser.ReadColumn <byte>(61);
            Unknown62           = parser.ReadColumn <byte>(62);
            NpcEquip            = new LazyRow <NpcEquip>(gameData, parser.ReadColumn <ushort>(63), language);
            Behavior            = new LazyRow <Behavior>(gameData, parser.ReadColumn <ushort>(64), language);
            ModelMainHand       = parser.ReadColumn <ulong>(65);
            DyeMainHand         = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(66), language);
            ModelOffHand        = parser.ReadColumn <ulong>(67);
            DyeOffHand          = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(68), language);
            ModelHead           = parser.ReadColumn <uint>(69);
            DyeHead             = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(70), language);
            Visor               = parser.ReadColumn <bool>(71);
            ModelBody           = parser.ReadColumn <uint>(72);
            DyeBody             = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(73), language);
            ModelHands          = parser.ReadColumn <uint>(74);
            DyeHands            = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(75), language);
            ModelLegs           = parser.ReadColumn <uint>(76);
            DyeLegs             = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(77), language);
            ModelFeet           = parser.ReadColumn <uint>(78);
            DyeFeet             = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(79), language);
            ModelEars           = parser.ReadColumn <uint>(80);
            DyeEars             = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(81), language);
            ModelNeck           = parser.ReadColumn <uint>(82);
            DyeNeck             = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(83), language);
            ModelWrists         = parser.ReadColumn <uint>(84);
            DyeWrists           = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(85), language);
            ModelLeftRing       = parser.ReadColumn <uint>(86);
            DyeLeftRing         = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(87), language);
            ModelRightRing      = parser.ReadColumn <uint>(88);
            DyeRightRing        = new LazyRow <Stain>(gameData, parser.ReadColumn <byte>(89), language);
            Invisibility        = parser.ReadColumn <byte>(90);
            Balloon             = new LazyRow <Balloon>(gameData, parser.ReadColumn <ushort>(91), language);
            NotRewriteHeight    = parser.ReadColumn <bool>(92);
            DefaultBalloon      = parser.ReadColumn <byte>(93);
            Unknown94           = parser.ReadColumn <byte>(94);
        }
Exemplo n.º 33
0
        public override void PopulateData(RowParser parser, GameData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            Unknown0     = parser.ReadColumn <SeString>(0);
            ItemAccepted = new LazyRow <Item> [32];
            for (var i = 0; i < 32; i++)
            {
                ItemAccepted[i] = new LazyRow <Item>(gameData, parser.ReadColumn <int>(1 + i), language);
            }
            AmountAccepted = new uint[32];
            for (var i = 0; i < 32; i++)
            {
                AmountAccepted[i] = parser.ReadColumn <uint>(33 + i);
            }
            Unknown65  = parser.ReadColumn <byte>(65);
            Unknown66  = parser.ReadColumn <byte>(66);
            Unknown67  = parser.ReadColumn <byte>(67);
            Unknown68  = parser.ReadColumn <byte>(68);
            Unknown69  = parser.ReadColumn <byte>(69);
            Unknown70  = parser.ReadColumn <byte>(70);
            Unknown71  = parser.ReadColumn <byte>(71);
            Unknown72  = parser.ReadColumn <byte>(72);
            Unknown73  = parser.ReadColumn <byte>(73);
            Unknown74  = parser.ReadColumn <byte>(74);
            Unknown75  = parser.ReadColumn <byte>(75);
            Unknown76  = parser.ReadColumn <byte>(76);
            Unknown77  = parser.ReadColumn <byte>(77);
            Unknown78  = parser.ReadColumn <byte>(78);
            Unknown79  = parser.ReadColumn <byte>(79);
            Unknown80  = parser.ReadColumn <byte>(80);
            Unknown81  = parser.ReadColumn <byte>(81);
            Unknown82  = parser.ReadColumn <byte>(82);
            Unknown83  = parser.ReadColumn <byte>(83);
            Unknown84  = parser.ReadColumn <byte>(84);
            Unknown85  = parser.ReadColumn <byte>(85);
            Unknown86  = parser.ReadColumn <byte>(86);
            Unknown87  = parser.ReadColumn <byte>(87);
            Unknown88  = parser.ReadColumn <byte>(88);
            Unknown89  = parser.ReadColumn <byte>(89);
            Unknown90  = parser.ReadColumn <byte>(90);
            Unknown91  = parser.ReadColumn <byte>(91);
            Unknown92  = parser.ReadColumn <byte>(92);
            Unknown93  = parser.ReadColumn <byte>(93);
            Unknown94  = parser.ReadColumn <byte>(94);
            Unknown95  = parser.ReadColumn <byte>(95);
            Unknown96  = parser.ReadColumn <byte>(96);
            Unknown97  = parser.ReadColumn <byte>(97);
            Unknown98  = parser.ReadColumn <byte>(98);
            Unknown99  = parser.ReadColumn <byte>(99);
            Unknown100 = parser.ReadColumn <byte>(100);
            Unknown101 = parser.ReadColumn <byte>(101);
            Unknown102 = parser.ReadColumn <byte>(102);
            Unknown103 = parser.ReadColumn <byte>(103);
            Unknown104 = parser.ReadColumn <byte>(104);
            Unknown105 = parser.ReadColumn <byte>(105);
            Unknown106 = parser.ReadColumn <byte>(106);
            Unknown107 = parser.ReadColumn <byte>(107);
            Unknown108 = parser.ReadColumn <byte>(108);
            Unknown109 = parser.ReadColumn <byte>(109);
            Unknown110 = parser.ReadColumn <byte>(110);
            Unknown111 = parser.ReadColumn <byte>(111);
            Unknown112 = parser.ReadColumn <byte>(112);
            Unknown113 = parser.ReadColumn <byte>(113);
            Unknown114 = parser.ReadColumn <byte>(114);
            Unknown115 = parser.ReadColumn <byte>(115);
            Unknown116 = parser.ReadColumn <byte>(116);
            Unknown117 = parser.ReadColumn <byte>(117);
            Unknown118 = parser.ReadColumn <byte>(118);
            Unknown119 = parser.ReadColumn <byte>(119);
            Unknown120 = parser.ReadColumn <byte>(120);
            Unknown121 = parser.ReadColumn <byte>(121);
            Unknown122 = parser.ReadColumn <byte>(122);
            Unknown123 = parser.ReadColumn <byte>(123);
            Unknown124 = parser.ReadColumn <byte>(124);
            Unknown125 = parser.ReadColumn <byte>(125);
            Unknown126 = parser.ReadColumn <byte>(126);
            Unknown127 = parser.ReadColumn <byte>(127);
            Unknown128 = parser.ReadColumn <byte>(128);
            Lua        = parser.ReadColumn <SeString>(129);
            LogMessage = new LazyRow <LogMessage> [3];
            for (var i = 0; i < 3; i++)
            {
                LogMessage[i] = new LazyRow <LogMessage>(gameData, parser.ReadColumn <uint>(130 + i), language);
            }
            Unknown133 = parser.ReadColumn <bool>(133);
        }
 private void Awake()
 {
     DontDestroyOnLoad(gameObject);
     currentInstance = this;
     GD = new GameData();
 }
Exemplo n.º 35
0
 protected override void Microgame()
 {
     Debug.Log("Não Implementada");
     GameManager.Text.text = GameData.GetTime().ToString();
 }
Exemplo n.º 36
0
	private void setItem(int index){
		switch (index) {
			case 1: //get a pistol
			GameData.setCurrentWeaponIndex(1);
			GameData.setCurrentWeaponAmmoInitial(7);
			GameData.setCurrentWeaponAmmoLeft(35);
			GameData.setCurrentWeaponAmmoUsing(7);
			GameData.setCurrentWeaponAmmoInitialLeft(35);
			GameData.setCurrentWeaponAmmoInitialUsing(7);
			GameData.setCurrentWeaponPower(20);
			GameAttribute.instance.currentWeaponIndex = 1;
			GameAttribute.instance.weaponPower = GameData.Weapon.Pistol.power;
			break;
			case 2:
			GameData.setCurrentWeaponIndex(1);
			GameData.setCurrentWeaponAmmoInitial(30);
			GameData.setCurrentWeaponAmmoLeft(120);
			GameData.setCurrentWeaponAmmoUsing(30);
			GameData.setCurrentWeaponAmmoInitialLeft(120);
			GameData.setCurrentWeaponAmmoInitialUsing(30);
			GameData.setCurrentWeaponPower(35);
			GameAttribute.instance.currentWeaponIndex = 2;
			GameAttribute.instance.weaponPower = GameData.Weapon.Rifile.power;
			break;
		case 101: //get an ammo
			GameData.setCurrentWeaponAmmoInitial(GameData.getCurrentWeaponAmmoInitial());
			GameData.setCurrentWeaponAmmoLeft(GameData.getCurrentWeaponAmmoInitialLeft());
			GameData.setCurrentWeaponAmmoUsing(GameData.getCurrentWeaponAmmoInitialUsing());
			break;
		case 102:// get a key
			GameData.setCurrentLevelKeyGet(1);
			break;
		case 103://get an medikit
			GameData.setCurrentHealth(GameData.getMaxHealth());
			GameAttribute.instance.playerCurrentHealth = GameData.getCurrentHealth();
			break;
		case -100:
			GameData.setNextLevel();
			StartCoroutine("ChangeLevel",GameData.getCurrentLevelName());
			break;
		case -99:
			GameData.setNextLevel();
			StartCoroutine("ChangeLevel",GameData.getCurrentLevelName());
			break;
		case -98:
			if(GameMaster.level3_finished == true){
				GameMaster.level3_finished = false;
				this.transform.position = new Vector3 (0, 0, -100);
				GameData.setNextLevel();
				StartCoroutine("ChangeLevel",GameData.getCurrentLevelName());
			}else{
				this.transform.position = new Vector3 (127, -25, -5);
			}
			break;
		case -97:
			Debug.Log(-97);
			GameData.setNextLevel();
			StartCoroutine("ChangeLevel",GameData.getCurrentLevelName());
			break;
		case -70:
			Application.LoadLevel("Scene_shop");
			break;
		}
	}
Exemplo n.º 37
0
        public IntroData(GameData gameData)
        {
            var introHunks = AmigaExecutable.Read(gameData.Files["Ambermoon_intro"].Files[1])
                             .Where(h => h.Type == AmigaExecutable.HunkType.Data).Select(h => new DataReader(((AmigaExecutable.Hunk)h).Data))
                             .ToList();
            var graphicReader = new GraphicReader();

            #region Hunk 0 - Palettes and texts

            var hunk0 = introHunks[0];

            Graphic LoadPalette()
            {
                var paletteGraphic = new Graphic();

                graphicReader.ReadGraphic(paletteGraphic, hunk0, paletteGraphicInfo);
                return(paletteGraphic);
            }

            for (int i = 0; i < 9; ++i)
            {
                introPalettes.Add(LoadPalette());
            }

            hunk0.Position += 8; // 8 unknown bytes

            for (int i = 0; i < 8; ++i)
            {
                byte startByte = hunk0.PeekByte();
                if (startByte != 0x20 && (startByte < 'A' || startByte > 'Z'))
                {
                    ++hunk0.Position; // Sometimes there is an unknown start byte
                }
                texts.Add((IntroText)i, hunk0.ReadNullTerminatedString());
            }

            if (hunk0.ReadByte() != 4) // Should contain the amount of main menu text (= 4)
            {
                throw new AmbermoonException(ExceptionScope.Data, "Wrong intro data.");
            }

            for (int i = 0; i < 4; ++i)
            {
                // The 4 main menu texts are prefixed by 2 bytes (x and y render offset).
                hunk0.Position += 2; // We skip those bytes here.
                texts.Add((IntroText)(8 + i), hunk0.ReadNullTerminatedString());
            }

            // TODO: the credits will follow

            #endregion

            #region Hunk 1 - Main menu background and town graphics

            Size[] hunk1ImageSizes = new Size[8]
            {
                new Size(96, 300), // not sure
                new Size(320, 256),
                new Size(160, 128),
                new Size(160, 128),
                new Size(160, 128),
                new Size(160, 128),
                new Size(160, 128),
                new Size(160, 128)
            };

            for (int i = 0; i < 8; ++i)
            {
                var reader = introHunks[1];

                if (reader.PeekDword() == 0x494d5021) // "IMP!", may be imploded
                {
                    reader = new DataReader(Deploder.DeplodeFimp(reader).Reverse().ToArray());
                }

                var graphicInfo = new GraphicInfo
                {
                    Width         = hunk1ImageSizes[i].Width,
                    Height        = hunk1ImageSizes[i].Height,
                    GraphicFormat = GraphicFormat.Palette4Bit,
                    PaletteOffset = 0,
                    Alpha         = false
                };
                var graphic = new Graphic();
                graphicReader.ReadGraphic(graphic, reader, graphicInfo);
                graphics.Add((IntroGraphic)i, graphic);
            }

            #endregion

            #region Hunk 2 - Unknown

            // TODO

            #endregion

            #region Hunk 3 - Intro graphics (planets, etc)

            Size[] hunk3ImageSizes = new Size[6]
            {
                new Size(128, 82),  // Thalion Logo
                new Size(64, 64),   // Sun
                new Size(128, 128), // Lyramion
                new Size(64, 64),   // Morag
                new Size(64, 64),   // Forest Moon
                new Size(96, 96),   // Meteor
                // TODO ...
            };
            int[] hunk3FrameCounts = new int[6]
            {
                1,
                12,
                1,
                1,
                1,
                1,
                // TODO ...
            };

            for (int i = 0; i < 6; ++i)
            {
                var graphicInfo = new GraphicInfo
                {
                    Width         = hunk3ImageSizes[i].Width,
                    Height        = hunk3ImageSizes[i].Height,
                    GraphicFormat = GraphicFormat.Palette4Bit,
                    PaletteOffset = 0,
                    Alpha         = false
                };
                Graphic graphic;
                int     frames = hunk3FrameCounts[i];
                if (frames == 1)
                {
                    graphic = new Graphic();
                    graphicReader.ReadGraphic(graphic, introHunks[3], graphicInfo);
                }
                else
                {
                    graphic = new Graphic(frames * graphicInfo.Width, graphicInfo.Height, 0);

                    for (int f = 0; f < frames; ++f)
                    {
                        var frameGraphic = new Graphic();
                        graphicReader.ReadGraphic(frameGraphic, introHunks[3], graphicInfo);
                        graphic.AddOverlay((uint)(f * frameGraphic.Width), 0, frameGraphic, false);
                    }
                }
                graphics.Add(IntroGraphic.ThalionLogo + i, graphic);
                if (i == 0) // The other graphics start at 0x42B8 (the data between is unknown yet)
                {
                    introHunks[3].Position = 0x42B8;
                }
            }

            // TODO ...

            #endregion
        }
Exemplo n.º 38
0
 private void SetGameData(GameData gd)
 {
     _exampleDatas = gd.exampleDatas;
 }
Exemplo n.º 39
0
 public FigureBishop(bool isWhite, GameData field, int row, int col)
     : base(isWhite, field, row, col)
 {
 }
Exemplo n.º 40
0
 // Use this for initialization
 void Start()
 {
     ga            = GameObject.Find("GameData").GetComponent <GameData>();
     coinText.text = "Coin : " + ga.coinNum.ToString();
 }
Exemplo n.º 41
0
        public override void PopulateData(RowParser parser, GameData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            Level1     = new LazyRow <Level>(gameData, parser.ReadColumn <int>(0), language);
            Level2     = new LazyRow <Level>(gameData, parser.ReadColumn <int>(1), language);
            Level3     = new LazyRow <Level>(gameData, parser.ReadColumn <int>(2), language);
            Unknown3   = parser.ReadColumn <int>(3);
            Unknown4   = parser.ReadColumn <int>(4);
            Unknown5   = parser.ReadColumn <int>(5);
            Unknown6   = parser.ReadColumn <int>(6);
            Unknown7   = parser.ReadColumn <int>(7);
            Unknown8   = parser.ReadColumn <int>(8);
            Unknown9   = parser.ReadColumn <int>(9);
            Unknown10  = parser.ReadColumn <int>(10);
            Unknown11  = parser.ReadColumn <int>(11);
            Unknown12  = parser.ReadColumn <int>(12);
            Unknown13  = parser.ReadColumn <int>(13);
            Unknown14  = parser.ReadColumn <int>(14);
            Unknown15  = parser.ReadColumn <int>(15);
            Unknown16  = parser.ReadColumn <int>(16);
            Unknown17  = parser.ReadColumn <int>(17);
            Unknown18  = parser.ReadColumn <int>(18);
            Unknown19  = parser.ReadColumn <int>(19);
            Unknown20  = parser.ReadColumn <int>(20);
            Unknown21  = parser.ReadColumn <int>(21);
            Unknown22  = parser.ReadColumn <int>(22);
            Unknown23  = parser.ReadColumn <int>(23);
            Unknown24  = parser.ReadColumn <int>(24);
            Unknown25  = parser.ReadColumn <int>(25);
            Unknown26  = parser.ReadColumn <int>(26);
            Unknown27  = parser.ReadColumn <int>(27);
            Unknown28  = parser.ReadColumn <int>(28);
            Unknown29  = parser.ReadColumn <int>(29);
            Unknown30  = parser.ReadColumn <int>(30);
            Unknown31  = parser.ReadColumn <int>(31);
            Unknown32  = parser.ReadColumn <int>(32);
            Unknown33  = parser.ReadColumn <int>(33);
            Unknown34  = parser.ReadColumn <int>(34);
            Unknown35  = parser.ReadColumn <int>(35);
            Unknown36  = parser.ReadColumn <int>(36);
            Unknown37  = parser.ReadColumn <int>(37);
            Unknown38  = parser.ReadColumn <int>(38);
            Unknown39  = parser.ReadColumn <int>(39);
            Unknown40  = parser.ReadColumn <int>(40);
            Unknown41  = parser.ReadColumn <int>(41);
            Unknown42  = parser.ReadColumn <int>(42);
            Unknown43  = parser.ReadColumn <int>(43);
            Unknown44  = parser.ReadColumn <int>(44);
            Unknown45  = parser.ReadColumn <int>(45);
            Unknown46  = parser.ReadColumn <int>(46);
            Unknown47  = parser.ReadColumn <int>(47);
            Unknown48  = parser.ReadColumn <int>(48);
            Unknown49  = parser.ReadColumn <int>(49);
            Unknown50  = parser.ReadColumn <int>(50);
            Unknown51  = parser.ReadColumn <int>(51);
            Unknown52  = parser.ReadColumn <int>(52);
            Unknown53  = parser.ReadColumn <int>(53);
            Unknown54  = parser.ReadColumn <int>(54);
            Unknown55  = parser.ReadColumn <int>(55);
            Unknown56  = parser.ReadColumn <int>(56);
            Unknown57  = parser.ReadColumn <int>(57);
            Unknown58  = parser.ReadColumn <int>(58);
            Unknown59  = parser.ReadColumn <int>(59);
            Unknown60  = parser.ReadColumn <int>(60);
            Unknown61  = parser.ReadColumn <int>(61);
            Unknown62  = parser.ReadColumn <int>(62);
            Unknown63  = parser.ReadColumn <int>(63);
            Unknown64  = parser.ReadColumn <int>(64);
            Unknown65  = parser.ReadColumn <int>(65);
            Unknown66  = parser.ReadColumn <int>(66);
            Unknown67  = parser.ReadColumn <int>(67);
            Unknown68  = parser.ReadColumn <int>(68);
            Unknown69  = parser.ReadColumn <int>(69);
            Unknown70  = parser.ReadColumn <int>(70);
            Unknown71  = parser.ReadColumn <int>(71);
            Unknown72  = parser.ReadColumn <int>(72);
            Unknown73  = parser.ReadColumn <int>(73);
            Unknown74  = parser.ReadColumn <int>(74);
            Unknown75  = parser.ReadColumn <int>(75);
            Unknown76  = parser.ReadColumn <int>(76);
            Unknown77  = parser.ReadColumn <int>(77);
            Unknown78  = parser.ReadColumn <int>(78);
            Unknown79  = parser.ReadColumn <int>(79);
            Unknown80  = parser.ReadColumn <int>(80);
            Unknown81  = parser.ReadColumn <int>(81);
            Unknown82  = parser.ReadColumn <int>(82);
            Unknown83  = parser.ReadColumn <int>(83);
            Unknown84  = parser.ReadColumn <int>(84);
            Unknown85  = parser.ReadColumn <int>(85);
            Unknown86  = parser.ReadColumn <int>(86);
            Unknown87  = parser.ReadColumn <int>(87);
            Unknown88  = parser.ReadColumn <int>(88);
            Unknown89  = parser.ReadColumn <byte>(89);
            Unknown90  = parser.ReadColumn <byte>(90);
            Unknown91  = parser.ReadColumn <byte>(91);
            Unknown92  = parser.ReadColumn <byte>(92);
            Unknown93  = parser.ReadColumn <byte>(93);
            Unknown94  = parser.ReadColumn <byte>(94);
            Unknown95  = parser.ReadColumn <byte>(95);
            Unknown96  = parser.ReadColumn <byte>(96);
            Unknown97  = parser.ReadColumn <byte>(97);
            Unknown98  = parser.ReadColumn <byte>(98);
            Unknown99  = parser.ReadColumn <byte>(99);
            Unknown100 = parser.ReadColumn <byte>(100);
            Unknown101 = parser.ReadColumn <byte>(101);
            Unknown102 = parser.ReadColumn <byte>(102);
            Unknown103 = parser.ReadColumn <byte>(103);
            Unknown104 = parser.ReadColumn <byte>(104);
            Unknown105 = parser.ReadColumn <byte>(105);
            Unknown106 = parser.ReadColumn <byte>(106);
            Unknown107 = parser.ReadColumn <byte>(107);
            Unknown108 = parser.ReadColumn <byte>(108);
            Unknown109 = parser.ReadColumn <byte>(109);
            Unknown110 = parser.ReadColumn <byte>(110);
            Unknown111 = parser.ReadColumn <byte>(111);
            Unknown112 = parser.ReadColumn <byte>(112);
            Unknown113 = parser.ReadColumn <byte>(113);
            Unknown114 = parser.ReadColumn <byte>(114);
            Unknown115 = parser.ReadColumn <byte>(115);
            Unknown116 = parser.ReadColumn <byte>(116);
            Unknown117 = parser.ReadColumn <byte>(117);
            Unknown118 = parser.ReadColumn <byte>(118);
            Unknown119 = parser.ReadColumn <byte>(119);
            Unknown120 = parser.ReadColumn <byte>(120);
            Unknown121 = parser.ReadColumn <byte>(121);
            Unknown122 = parser.ReadColumn <byte>(122);
            Unknown123 = parser.ReadColumn <byte>(123);
            Unknown124 = parser.ReadColumn <byte>(124);
            Unknown125 = parser.ReadColumn <byte>(125);
            Unknown126 = parser.ReadColumn <byte>(126);
            Unknown127 = parser.ReadColumn <byte>(127);
            Unknown128 = parser.ReadColumn <byte>(128);
            Unknown129 = parser.ReadColumn <byte>(129);
            Unknown130 = parser.ReadColumn <byte>(130);
            Unknown131 = parser.ReadColumn <byte>(131);
            Unknown132 = parser.ReadColumn <byte>(132);
            Unknown133 = parser.ReadColumn <byte>(133);
            Unknown134 = parser.ReadColumn <byte>(134);
            Unknown135 = parser.ReadColumn <byte>(135);
            Unknown136 = parser.ReadColumn <byte>(136);
            Unknown137 = parser.ReadColumn <byte>(137);
            Unknown138 = parser.ReadColumn <byte>(138);
            Unknown139 = parser.ReadColumn <byte>(139);
            Unknown140 = parser.ReadColumn <byte>(140);
            Unknown141 = parser.ReadColumn <byte>(141);
            Unknown142 = parser.ReadColumn <byte>(142);
            Unknown143 = parser.ReadColumn <byte>(143);
            Unknown144 = parser.ReadColumn <byte>(144);
            Unknown145 = parser.ReadColumn <byte>(145);
            Unknown146 = parser.ReadColumn <byte>(146);
            Unknown147 = parser.ReadColumn <byte>(147);
            Unknown148 = parser.ReadColumn <byte>(148);
            Unknown149 = parser.ReadColumn <byte>(149);
            Unknown150 = parser.ReadColumn <byte>(150);
            Unknown151 = parser.ReadColumn <byte>(151);
            Unknown152 = parser.ReadColumn <byte>(152);
            Unknown153 = parser.ReadColumn <byte>(153);
            Unknown154 = parser.ReadColumn <byte>(154);
            Unknown155 = parser.ReadColumn <byte>(155);
            Unknown156 = parser.ReadColumn <byte>(156);
            Unknown157 = parser.ReadColumn <byte>(157);
            Unknown158 = parser.ReadColumn <byte>(158);
            Unknown159 = parser.ReadColumn <byte>(159);
            Unknown160 = parser.ReadColumn <byte>(160);
            Unknown161 = parser.ReadColumn <byte>(161);
            Unknown162 = parser.ReadColumn <byte>(162);
            Unknown163 = parser.ReadColumn <byte>(163);
            Unknown164 = parser.ReadColumn <byte>(164);
            Unknown165 = parser.ReadColumn <byte>(165);
            Unknown166 = parser.ReadColumn <byte>(166);
            Unknown167 = parser.ReadColumn <byte>(167);
            Unknown168 = parser.ReadColumn <byte>(168);
            Unknown169 = parser.ReadColumn <byte>(169);
            Unknown170 = parser.ReadColumn <byte>(170);
            Unknown171 = parser.ReadColumn <byte>(171);
            Unknown172 = parser.ReadColumn <byte>(172);
            Unknown173 = parser.ReadColumn <byte>(173);
            Unknown174 = parser.ReadColumn <byte>(174);
            Unknown175 = parser.ReadColumn <byte>(175);
            Unknown176 = parser.ReadColumn <byte>(176);
            Unknown177 = parser.ReadColumn <byte>(177);
            Unknown178 = parser.ReadColumn <byte>(178);
            Unknown179 = parser.ReadColumn <byte>(179);
            Unknown180 = parser.ReadColumn <byte>(180);
            Unknown181 = parser.ReadColumn <byte>(181);
            Unknown182 = parser.ReadColumn <byte>(182);
            Unknown183 = parser.ReadColumn <byte>(183);
            Unknown184 = parser.ReadColumn <byte>(184);
            Unknown185 = parser.ReadColumn <byte>(185);
            Unknown186 = parser.ReadColumn <byte>(186);
            Unknown187 = parser.ReadColumn <byte>(187);
            Unknown188 = parser.ReadColumn <byte>(188);
            Unknown189 = parser.ReadColumn <byte>(189);
            Unknown190 = parser.ReadColumn <byte>(190);
            Unknown191 = parser.ReadColumn <byte>(191);
            Unknown192 = parser.ReadColumn <byte>(192);
            Unknown193 = parser.ReadColumn <byte>(193);
            Unknown194 = parser.ReadColumn <byte>(194);
            Unknown195 = parser.ReadColumn <byte>(195);
            Unknown196 = parser.ReadColumn <byte>(196);
            Unknown197 = parser.ReadColumn <byte>(197);
            Unknown198 = parser.ReadColumn <byte>(198);
            Unknown199 = parser.ReadColumn <byte>(199);
            Unknown200 = parser.ReadColumn <byte>(200);
            Unknown201 = parser.ReadColumn <byte>(201);
            Unknown202 = parser.ReadColumn <byte>(202);
            Unknown203 = parser.ReadColumn <byte>(203);
            Unknown204 = parser.ReadColumn <byte>(204);
            Unknown205 = parser.ReadColumn <byte>(205);
            Unknown206 = parser.ReadColumn <byte>(206);
            Unknown207 = parser.ReadColumn <byte>(207);
            Unknown208 = parser.ReadColumn <byte>(208);
            Unknown209 = parser.ReadColumn <byte>(209);
            Unknown210 = parser.ReadColumn <byte>(210);
            Unknown211 = parser.ReadColumn <byte>(211);
            Unknown212 = parser.ReadColumn <byte>(212);
            Unknown213 = parser.ReadColumn <byte>(213);
            Unknown214 = parser.ReadColumn <byte>(214);
            Unknown215 = parser.ReadColumn <byte>(215);
            Unknown216 = parser.ReadColumn <byte>(216);
            Unknown217 = parser.ReadColumn <byte>(217);
            Unknown218 = parser.ReadColumn <byte>(218);
            Unknown219 = parser.ReadColumn <byte>(219);
            Unknown220 = parser.ReadColumn <byte>(220);
            Unknown221 = parser.ReadColumn <byte>(221);
            Unknown222 = parser.ReadColumn <byte>(222);
            Unknown223 = parser.ReadColumn <byte>(223);
            Unknown224 = parser.ReadColumn <byte>(224);
            Unknown225 = parser.ReadColumn <byte>(225);
            Unknown226 = parser.ReadColumn <byte>(226);
            Unknown227 = parser.ReadColumn <byte>(227);
            Unknown228 = parser.ReadColumn <byte>(228);
            Unknown229 = parser.ReadColumn <byte>(229);
            Unknown230 = parser.ReadColumn <byte>(230);
            Unknown231 = parser.ReadColumn <byte>(231);
            Unknown232 = parser.ReadColumn <byte>(232);
            Unknown233 = parser.ReadColumn <byte>(233);
            Unknown234 = parser.ReadColumn <byte>(234);
            Unknown235 = parser.ReadColumn <byte>(235);
            Unknown236 = parser.ReadColumn <byte>(236);
            Unknown237 = parser.ReadColumn <byte>(237);
            Unknown238 = parser.ReadColumn <byte>(238);
            Unknown239 = parser.ReadColumn <byte>(239);
            Unknown240 = parser.ReadColumn <byte>(240);
            Unknown241 = parser.ReadColumn <byte>(241);
            Unknown242 = parser.ReadColumn <byte>(242);
            Unknown243 = parser.ReadColumn <byte>(243);
            Unknown244 = parser.ReadColumn <byte>(244);
            Unknown245 = parser.ReadColumn <byte>(245);
            Unknown246 = parser.ReadColumn <byte>(246);
            Unknown247 = parser.ReadColumn <byte>(247);
            Unknown248 = parser.ReadColumn <byte>(248);
            Unknown249 = parser.ReadColumn <byte>(249);
            Unknown250 = parser.ReadColumn <byte>(250);
            Unknown251 = parser.ReadColumn <byte>(251);
            Unknown252 = parser.ReadColumn <byte>(252);
            Unknown253 = parser.ReadColumn <byte>(253);
            Unknown254 = parser.ReadColumn <byte>(254);
            Unknown255 = parser.ReadColumn <byte>(255);
            Unknown256 = parser.ReadColumn <byte>(256);
            Unknown257 = parser.ReadColumn <byte>(257);
            Unknown258 = parser.ReadColumn <byte>(258);
            Unknown259 = parser.ReadColumn <byte>(259);
            Unknown260 = parser.ReadColumn <byte>(260);
            Unknown261 = parser.ReadColumn <byte>(261);
            Unknown262 = parser.ReadColumn <byte>(262);
            Unknown263 = parser.ReadColumn <byte>(263);
            Unknown264 = parser.ReadColumn <byte>(264);
            Unknown265 = parser.ReadColumn <byte>(265);
            Unknown266 = parser.ReadColumn <byte>(266);
            Unknown267 = parser.ReadColumn <byte>(267);
            Unknown268 = parser.ReadColumn <byte>(268);
            Unknown269 = parser.ReadColumn <byte>(269);
            Unknown270 = parser.ReadColumn <byte>(270);
            Unknown271 = parser.ReadColumn <byte>(271);
            Unknown272 = parser.ReadColumn <byte>(272);
            Unknown273 = parser.ReadColumn <int>(273);
            Unknown274 = parser.ReadColumn <int>(274);
            Unknown275 = parser.ReadColumn <int>(275);
            Unknown276 = parser.ReadColumn <int>(276);
            Unknown277 = parser.ReadColumn <int>(277);
            Unknown278 = parser.ReadColumn <int>(278);
            Unknown279 = parser.ReadColumn <int>(279);
            Unknown280 = parser.ReadColumn <int>(280);
            Unknown281 = parser.ReadColumn <int>(281);
            Unknown282 = parser.ReadColumn <int>(282);
            Unknown283 = parser.ReadColumn <int>(283);
            Unknown284 = parser.ReadColumn <int>(284);
            Unknown285 = parser.ReadColumn <int>(285);
            Unknown286 = parser.ReadColumn <int>(286);
            Unknown287 = parser.ReadColumn <int>(287);
            Unknown288 = parser.ReadColumn <int>(288);
            Unknown289 = parser.ReadColumn <int>(289);
            Unknown290 = parser.ReadColumn <int>(290);
            Unknown291 = parser.ReadColumn <int>(291);
            Unknown292 = parser.ReadColumn <int>(292);
            Unknown293 = parser.ReadColumn <int>(293);
            Unknown294 = parser.ReadColumn <int>(294);
            Unknown295 = parser.ReadColumn <int>(295);
            Unknown296 = parser.ReadColumn <int>(296);
            Unknown297 = parser.ReadColumn <int>(297);
            Unknown298 = parser.ReadColumn <int>(298);
            Unknown299 = parser.ReadColumn <int>(299);
            Unknown300 = parser.ReadColumn <int>(300);
            Unknown301 = parser.ReadColumn <int>(301);
            Unknown302 = parser.ReadColumn <int>(302);
            Unknown303 = parser.ReadColumn <int>(303);
            Unknown304 = parser.ReadColumn <int>(304);
            Unknown305 = parser.ReadColumn <int>(305);
            Unknown306 = parser.ReadColumn <int>(306);
            Unknown307 = parser.ReadColumn <int>(307);
            Unknown308 = parser.ReadColumn <int>(308);
            Unknown309 = parser.ReadColumn <int>(309);
            Unknown310 = parser.ReadColumn <int>(310);
            Unknown311 = parser.ReadColumn <int>(311);
            Unknown312 = parser.ReadColumn <int>(312);
            Unknown313 = parser.ReadColumn <int>(313);
            Unknown314 = parser.ReadColumn <int>(314);
            Unknown315 = parser.ReadColumn <int>(315);
            Unknown316 = parser.ReadColumn <int>(316);
            Unknown317 = parser.ReadColumn <int>(317);
            Unknown318 = parser.ReadColumn <int>(318);
            Unknown319 = parser.ReadColumn <int>(319);
            Unknown320 = parser.ReadColumn <int>(320);
            Unknown321 = parser.ReadColumn <int>(321);
            Unknown322 = parser.ReadColumn <int>(322);
            Unknown323 = parser.ReadColumn <int>(323);
            Unknown324 = parser.ReadColumn <int>(324);
            Unknown325 = parser.ReadColumn <int>(325);
            Unknown326 = parser.ReadColumn <int>(326);
            Unknown327 = parser.ReadColumn <int>(327);
            Unknown328 = parser.ReadColumn <int>(328);
            Unknown329 = parser.ReadColumn <int>(329);
            Unknown330 = parser.ReadColumn <int>(330);
            Unknown331 = parser.ReadColumn <int>(331);
            Unknown332 = parser.ReadColumn <int>(332);
            Unknown333 = parser.ReadColumn <int>(333);
            Unknown334 = parser.ReadColumn <int>(334);
            Unknown335 = parser.ReadColumn <int>(335);
            Unknown336 = parser.ReadColumn <int>(336);
            Unknown337 = parser.ReadColumn <int>(337);
            Unknown338 = parser.ReadColumn <int>(338);
            Unknown339 = parser.ReadColumn <int>(339);
            Unknown340 = parser.ReadColumn <int>(340);
            Unknown341 = parser.ReadColumn <int>(341);
            Unknown342 = parser.ReadColumn <int>(342);
            Unknown343 = parser.ReadColumn <int>(343);
            Unknown344 = parser.ReadColumn <int>(344);
            Unknown345 = parser.ReadColumn <int>(345);
            Unknown346 = parser.ReadColumn <int>(346);
            Unknown347 = parser.ReadColumn <int>(347);
            Unknown348 = parser.ReadColumn <int>(348);
            Unknown349 = parser.ReadColumn <int>(349);
            Unknown350 = parser.ReadColumn <int>(350);
            Unknown351 = parser.ReadColumn <int>(351);
            Unknown352 = parser.ReadColumn <int>(352);
            Unknown353 = parser.ReadColumn <int>(353);
            Unknown354 = parser.ReadColumn <int>(354);
            Unknown355 = parser.ReadColumn <int>(355);
            Unknown356 = parser.ReadColumn <int>(356);
            Unknown357 = parser.ReadColumn <int>(357);
            Unknown358 = parser.ReadColumn <int>(358);
            Unknown359 = parser.ReadColumn <int>(359);
            Unknown360 = parser.ReadColumn <int>(360);
            Unknown361 = parser.ReadColumn <int>(361);
            Unknown362 = parser.ReadColumn <int>(362);
            Unknown363 = parser.ReadColumn <int>(363);
            Unknown364 = parser.ReadColumn <int>(364);
            Unknown365 = parser.ReadColumn <int>(365);
            Unknown366 = parser.ReadColumn <int>(366);
            Unknown367 = parser.ReadColumn <int>(367);
            Unknown368 = parser.ReadColumn <int>(368);
        }
Exemplo n.º 42
0
 protected virtual void Awake()
 {
     GameData = GameData.Load();
 }
Exemplo n.º 43
0
    public void OnClickBuy()
    {
        if (!isEmerald)
        {
            GameData.useMoney(GameData.ElementBoxList[BoxIndex].bricks);
        }
        else
        {
            GameData.useEmerald(GameData.ElementBoxList[BoxIndex].emerald);
        }
        ConfirmPanel.SetActive(true);

        ConfirmPanel.transform.FindChild("Box").gameObject.SetActive(true);
        ConfirmPanel.transform.FindChild("Rewords").gameObject.SetActive(false);
        ConfirmPanel.transform.FindChild("Box").FindChild("Image").GetComponent <Image>().sprite = Resources.LoadAll <Sprite>("char/elebox")[BoxIndex];

        string[] getData = GameData.ElementBoxList[BoxIndex].reword.Split('_');
        for (int i = 0; i < 6; i++)
        {
            if (i < getData.Length)
            {
                string[] tmp = getData[i].Split('|');

                if (tmp[0].Equals("El"))
                {
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("Cost").GetComponent <Text>().text = "재료를 성공적으로 획득하였습니다.";
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).gameObject.SetActive(true);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetComponent <GridLayoutGroup>().cellSize = new Vector2(120, 110);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Image").GetComponent <Image>().sprite =
                        Resources.Load <Sprite>("Element/" + GameData.ElementList[int.Parse(tmp[1])].id);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text =
                        "" + GameData.ElementList[int.Parse(tmp[1])].name;
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().color = new Color32(199, 183, 171, 255);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text =
                        "" + int.Parse(tmp[2]);

                    GameData.setElement(int.Parse(tmp[1]), int.Parse(tmp[2]));
                }
                else if (tmp[0].Equals("RAN"))
                {
                    int elecount = GameData.ElementList.Count;

                    while (true)
                    {
                        RandomNum  = Random.Range(0, GameData.ElementList.Count);
                        RandomTier = GameData.ElementList[RandomNum].value;

                        if (RandomTier == int.Parse(tmp[1]))
                        {
                            break;
                        }
                    }

                    int randomNum = RandomNum;
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("Cost").GetComponent <Text>().text = "재료를 성공적으로 획득하였습니다.";
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).gameObject.SetActive(true);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Image").GetComponent <Image>().sprite =
                        Resources.Load <Sprite>("Element/" + GameData.ElementList[randomNum].id);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text =
                        "" + GameData.ElementList[randomNum].name;
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().color = new Color32(255, 255, 255, 255);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text =
                        "" + int.Parse(tmp[2]);

                    GameData.setElement(randomNum, int.Parse(tmp[2]));
                }
                else if (tmp[0].Equals("DO"))
                {
                    i = 5;
                    if (int.Parse(tmp[1]) == 0)
                    {
                        while (true)
                        {
                            RandomNum  = Random.Range(14, GameData.ItemList.Count);
                            RandomTier = GameData.ItemList[RandomNum].Tier;

                            if (RandomTier == 1 || RandomTier == 2 || RandomTier == 3)
                            {
                                break;
                            }
                        }
                    }
                    else if (int.Parse(tmp[1]) == 1)
                    {
                        while (true)
                        {
                            RandomNum  = Random.Range(14, GameData.ItemList.Count);
                            RandomTier = GameData.ItemList[RandomNum].Tier;

                            if (RandomTier == 3 || RandomTier == 4 || RandomTier == 5)
                            {
                                break;
                            }
                        }
                    }

                    for (int j = 0; j < 5; j++)
                    {
                        ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(j).gameObject.SetActive(false);
                    }

                    ConfirmPanel.transform.FindChild("Rewords").FindChild("Cost").GetComponent <Text>().text = "도면을 성공적으로 획득하였습니다.";
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).gameObject.SetActive(true);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Image").GetComponent <Image>().sprite =
                        Resources.Load <Sprite>("Item/" + GameData.ItemList[RandomNum].id);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().text =
                        "" + GameData.ItemList[RandomNum].name;
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Name").GetComponent <Text>().color = new Color32(255, 255, 255, 255);
                    ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text = "";

                    for (int j = 0; j < RandomTier; j++)
                    {
                        ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).FindChild("Count").GetComponent <Text>().text += "★";
                    }

                    GameData.setAbleMake(RandomNum);

                    break;
                }
            }
            else
            {
                ConfirmPanel.transform.FindChild("Rewords").FindChild("elements").GetChild(i).gameObject.SetActive(false);
            }
        }
    }
Exemplo n.º 44
0
 public FollowStrategy(D2gsConnection connection, GameData gameData) : base(connection, gameData)
 {
 }
Exemplo n.º 45
0
    public void Initialize()
    {
        switch (currentGameMode)
        {
        case GameMode.BasicPoints:
        default:
            SetGameMode(new BasicMode());
            break;

        case GameMode.BasicHealth:
            SetGameMode(new BasicMode(ScoreMode.Health));
            break;
            //case GameMode.Timed:
            //    SetGameMode(new BasicMode(ScoreMode.Points, -1, 1, 180));
            break;

        case GameMode.Chicken:
            SetGameMode(new ChickenMode());
            break;

        case GameMode.Tag:
            SetGameMode(new TagMode());
            break;

        case GameMode.Owned:
            SetGameMode(new OwnedMode());
            break;
        }

        PlayerMovement[] tempps = FindObjectsOfType <PlayerMovement>();
        PlayerMovement[] ps     = new PlayerMovement[4];

        for (int i = 0; i < tempps.Length; i++) //sorting based on playerID
        {
            ps[(int)tempps[i].playerID] = tempps[i];
        }


        if (gameMode is TagMode && !initialized)
        {
            ((TagMode)gameMode).SetTag(tempps[UnityEngine.Random.Range(0, tempps.Length)].gameObject);
        }

        initialized       = true;
        gameTimerText     = GameObject.Find("GameTimer").GetComponent <Text>();
        players           = 4;
        playerSprites     = new SpriteRenderer[4];
        hudSprites        = new SpriteRenderer[4];
        overlayHudSprites = new SpriteRenderer[4];
        scoreText         = new Text[4];
        for (int i = 0; i < 4; i++)
        {
            if (ps[i] == null)
            {
                continue;
            }
            playerSprites[i] = ps[i].gameObject.GetComponent <SpriteRenderer>();

            //create new object to hold the hud image
            GameObject     sprite = new GameObject("HudSprite " + i);
            SpriteRenderer newSR  = sprite.AddComponent <SpriteRenderer>();
            newSR.sortingOrder = -9;
            hudSprites[i]      = newSR;

            //set its position
            sprite.transform.parent = canvas.transform;

            sprite.transform.localScale    = SpriteScale;
            sprite.transform.localPosition = HudIconPositon + SpriteDistance * i;

            //create text next to the image to display score/lives
            GameObject textHolder = new GameObject("hudSprite " + i + " text");

            textHolder.transform.parent     = sprite.transform;
            textHolder.transform.localScale = new Vector3(1, 1, 1);
            scoreText[i]      = textHolder.AddComponent <Text>();
            scoreText[i].font = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;
            textHolder.GetComponent <RectTransform>().localPosition = new Vector2(80, 0) + SpriteDistance * i * 10;

            //object to hold overlays that are also present on the player (mostly powerup indications)
            GameObject overlay = new GameObject("HudSpriteOverlay " + i);
            overlay.transform.parent        = sprite.transform;
            overlay.transform.localPosition = Vector2.zero;
            overlay.transform.localScale   *= sprite.transform.localScale.x;
            SpriteRenderer overSR = overlay.AddComponent <SpriteRenderer>();
            overSR.sortingOrder  = -8;
            overlayHudSprites[i] = overSR;
        }

        ScoreManager.instance = this;
        score = new float[players];

        //set score to set amount of lives instead of 0 in case of health start
        if (scoreMode == ScoreMode.Health)
        {
            for (int i = 0; i < score.GetLength(0); i++)
            {
                score[i] = StartingLives;
            }
        }
        UpdateScore();
        gameData         = new GameData();
        gameData.Players = tempps.Length;


        if (!CountDown.Instance)
        {
            gameObject.AddComponent <CountDown>();
        }
        if (!CountDown.Instance.IsRunning)
        {
            CountDown.Instance.StartCountDown(3, true, null);
        }
    }
Exemplo n.º 46
0
    IEnumerator UpdateServerData()
    {
        WWW www = new WWW("http://abricks.kr/mis_server.php?Mode=insultData&nickname=" + GameData.getName() + "&level=" + GameData.getLevel() + "&star=" + GameData.getStar() + "&bricks=" + GameData.getMoney() + "&emerald=" + GameData.getEmerald());

        yield return(www);
    }
Exemplo n.º 47
0
        public override void PopulateData(RowParser parser, GameData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            ClassJob = new LazyRow <ClassJob>(gameData, parser.ReadColumn <byte>(0), language);
        }
Exemplo n.º 48
0
    IEnumerator CreateGuest()
    {
        yield return(new WaitForSeconds(1f));

        while (true)
        {
            yield return(new WaitForSeconds(2f));

            if (CloseShop == false)
            {
                int ranNum = UnityEngine.Random.Range(0, 1000);
                if (ranNum < GameData.getStar() + 120 && !Shop_.isActiveUI)
                {
                    ranNum = UnityEngine.Random.Range(1 + (4 * GameData.getSpaceNum()), 5 + (4 * GameData.getSpaceNum()));
                    if (!Shop_.isActiveUI)
                    {
                        Guest = Resources.Load <GameObject>("Guest/Guests" + ranNum);
                        GameObject guest;
                        guest = Instantiate(Guest, Guests.transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
                        guest.transform.SetParent(Guests.transform);
                        if (haveQuestGuest == false)
                        {
                            int rand = UnityEngine.Random.Range(0, 100);
                            if (rand > 80)
                            {
                                GameObject.Find("Audio").transform.FindChild("shop_bell").GetComponent <AudioSource>().Play();
                                guest.GetComponent <GuestScript>().setGuestType(GuestScript.GuestType.HaveQuest);
                                haveQuestGuest = true;
                            }
                            else
                            {
                                guest.GetComponent <GuestScript>().setGuestType(GuestScript.GuestType.Normal);
                            }
                        }
                        else
                        {
                            guest.GetComponent <GuestScript>().setGuestType(GuestScript.GuestType.Normal);
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 49
0
    void Awake()
    {
        if (gameData == null)
        {
            DontDestroyOnLoad(this.gameObject);
            gameData = this;
        }
        else if (gameData != null)
        {
            Destroy(this);
        }



        //PlayGamesPlatform.Activate();

        if (Social.localUser.authenticated == false)
        {
            Social.localUser.Authenticate((bool success) =>
            {
                Debug.Log("Connected");
            });

            Advertisement.Initialize("1772390");
        }



        //wenn keine Datne auf Handy gefunden werden bzw. kein Spieler eingeloggt ist
        if (true)
        {
            LevelMap = new int[20];
            SetLevelToStart();

            equiptItem1 = new bool[4];
            equiptItem2 = new bool[4];
            equiptItem3 = new bool[4];
            equiptItem4 = new bool[4];

            ownItem1 = new bool[4];
            ownItem2 = new bool[4];
            ownItem3 = new bool[4];
            ownItem4 = new bool[4];

            for (int i = 0; i < equiptItem1.Length; i++)
            {
                equiptItem1[i] = false;
                equiptItem2[i] = false;
                equiptItem3[i] = false;
                equiptItem4[i] = false;

                ownItem1[i] = false;
                ownItem2[i] = false;
                ownItem3[i] = false;
                ownItem4[i] = false;
            }

            money = 100000;

            skillLaserDamage   = 0;
            skillLaserSpeed    = 0;
            skillTurbineSpeed  = 0;
            skillHullStability = 0;
        }
        else
        {
            //Load from Handy
        }
    }
Exemplo n.º 50
0
    public void Save()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/saveData.dat");

        GameData gameData = new GameData();

        for (int i = 0; i < 10; i++)
        {
            for (int j = 0; j < 10; j++)
            {
                gameData.LocData[i][j].Name               = _game.Map[i][j].name;
                gameData.LocData[i][j].Reclaimed          = _game.Map[i][j].Reclaimed;
                gameData.LocData[i][j].Scouted            = _game.Map[i][j].Scouted;
                gameData.LocData[i][j].NeighboursAttached = _game.Map[i][j].NeighboursAttached;
                gameData.LocData[i][j].FoodAmount         = _game.Map[i][j].FoodAmount;
                gameData.LocData[i][j].ZombiesAmount      = _game.Map[i][j].ZombiesAmount;
                gameData.LocData[i][j].SurvPresStatus     = _game.Map[i][j].SurvPresStatus;
                gameData.LocData[i][j].FoodPresStatus     = _game.Map[i][j].FoodPresStatus;
                gameData.LocData[i][j].InfestedStatus     = _game.Map[i][j].InfestedStatus;
                gameData.LocData[i][j].Sibling            = _game.Map[i][j].transform.GetSiblingIndex();
                gameData.LocData[i][j].LocPos             = new LocationPosition(_game.Map[i][j].AncoredPos.x, _game.Map[i][j].AncoredPos.y, _game.Map[i][j].AncoredPos.z);

                for (int n = 0; n < _game.Map[i][j].SurvPres.Count; n++)
                {
                    gameData.LocData[i][j].LocSurvPres.Add(new SurvivorData());
                    gameData.LocData[i][j].LocSurvPres[n].Name           = _game.Map[i][j].SurvPres[n].Name;
                    gameData.LocData[i][j].LocSurvPres[n].Status         = _game.Map[i][j].SurvPres[n].Status;
                    gameData.LocData[i][j].LocSurvPres[n].Selected       = _game.Map[i][j].SurvPres[n].Selected;
                    gameData.LocData[i][j].LocSurvPres[n].Alive          = _game.Map[i][j].SurvPres[n].Alive;
                    gameData.LocData[i][j].LocSurvPres[n].Id             = _game.Map[i][j].SurvPres[n].Id;
                    gameData.LocData[i][j].LocSurvPres[n].Specialisation = _game.Map[i][j].SurvPres[n].Specialisation;
                }

                for (int n = 0; n < _game.Map[i][j].SpotSurv.Count; n++)
                {
                    gameData.LocData[i][j].LocSpotSurvPres.Add(new SurvivorData());
                    gameData.LocData[i][j].LocSpotSurvPres[n].Name           = _game.Map[i][j].SurvPres[n].Name;
                    gameData.LocData[i][j].LocSpotSurvPres[n].Status         = _game.Map[i][j].SurvPres[n].Status;
                    gameData.LocData[i][j].LocSpotSurvPres[n].Selected       = _game.Map[i][j].SurvPres[n].Selected;
                    gameData.LocData[i][j].LocSpotSurvPres[n].Alive          = _game.Map[i][j].SurvPres[n].Alive;
                    gameData.LocData[i][j].LocSpotSurvPres[n].Id             = _game.Map[i][j].SurvPres[n].Id;
                    gameData.LocData[i][j].LocSpotSurvPres[n].Specialisation = _game.Map[i][j].SurvPres[n].Specialisation;
                }
            }
        }

        for (int i = 0; i < _game.Survivors.Count; i++)
        {
            gameData.SurvData.Add(new SurvivorData());
            gameData.SurvData[i].Name           = _game.Survivors[i].Name;
            gameData.SurvData[i].Status         = _game.Survivors[i].Status;
            gameData.SurvData[i].Selected       = _game.Survivors[i].Selected;
            gameData.SurvData[i].Alive          = _game.Survivors[i].Alive;
            gameData.SurvData[i].Id             = _game.Survivors[i].Id;
            gameData.SurvData[i].Specialisation = _game.Survivors[i].Specialisation;
        }

        for (int i = 0; i < _game.DefenseSurv.Count; i++)
        {
            gameData.DefenseSurvId.Add(_game.DefenseSurv[i].Id);
        }

        for (int i = 0; i < _game.ActiveMissions.Count; i++)
        {
            gameData.ActMissionData.Add(new MissionData());
            gameData.ActMissionData[i].CurLocId = _game.ActiveMissions[i].CurLoc.Id;

            for (int n = 0; n < _game.ActiveMissions[i].SelSurv.Count; n++)
            {
                gameData.ActMissionData[i].SelSurvId.Add(_game.ActiveMissions[i].SelSurv[n].Id);
            }

            gameData.ActMissionData[i].RequareSurv    = _game.ActiveMissions[i].RequareSurv;
            gameData.ActMissionData[i].RequareTime    = _game.ActiveMissions[i].RequareTime;
            gameData.ActMissionData[i].MinRequareTime = _game.ActiveMissions[i].MinRequareTime;
            gameData.ActMissionData[i].MaxRequareTime = _game.ActiveMissions[i].MaxRequareTime;
            gameData.ActMissionData[i].Danger         = _game.ActiveMissions[i].Danger;
            gameData.ActMissionData[i].MinDanger      = _game.ActiveMissions[i].MinDanger;
            gameData.ActMissionData[i].MaxDanger      = _game.ActiveMissions[i].MaxDanger;
            gameData.ActMissionData[i].Status         = _game.ActiveMissions[i].Status;
            gameData.ActMissionData[i].Name           = _game.ActiveMissions[i].GetType().Name;
        }

        gameData.CurLocId             = _game.CurLocId;
        gameData.CurMissionId         = _game.CurMissionId;
        gameData.MapSize              = _game.MapSize;
        gameData.Days                 = _game.Days;
        gameData.IdleSurv             = _game.IdleSurv;
        gameData.LivingSpace          = _game.LivingSpace;
        gameData.Food                 = _game.Food;
        gameData.Happiness            = _game.Happiness;
        gameData.Defense              = _game.Defense;
        gameData.DefenseFromBuildings = _game.DefenseFromBuildings;
        gameData.FoodExtraction       = _game.FoodExtraction;
        gameData.FoodIntake           = _game.FoodIntake;

        bf.Serialize(file, gameData);
        file.Close();

        Debug.Log("Saved");
    }
Exemplo n.º 51
0
    void SpawnCharacterLine(string line, Color text)
    {
        if (string.IsNullOrEmpty(line))
        {
            needsPlayerSpawn = true;
            return;
        }

        DialogueWriter spawned = Instantiate(characterTextPrefab, dialogueScrollList).GetComponent <DialogueWriter>();

        spawned.SetAudio(() => AudioManager.PlaySound("Writting"), () => AudioManager.StopSound("Writting"));
        spawned.Play(line, dialogueSpeed, highlightLength, Skinning.GetSkin(characterHighlightColor), GameData.LerpColorHSV(text, 0, 0.1f, -0.3f));

        lastWriter       = spawned;
        needsPlayerSpawn = true;
        characterDone    = false;
    }
Exemplo n.º 52
0
    public void Load()
    {
        if (File.Exists(Application.persistentDataPath + "/saveData.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/saveData.dat", FileMode.Open);

            GameData gameData = (GameData)bf.Deserialize(file);
            file.Close();

            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    if (_game.Map[i][j] == null)
                    {
                        int        newLocId = _game.LocPrefs.FindIndex(pref => pref.name == gameData.LocData[i][j].Name);
                        GameObject newPref  = _game.LocPrefs.Find(pref => pref.name == gameData.LocData[i][j].Name).gameObject;
                        GameObject newLoc   = Instantiate(newPref) as GameObject;
                        newLoc.transform.SetParent(transform);
                        newLoc.transform.SetSiblingIndex(gameData.LocData[i][j].Sibling);

                        if (_game.CheckType(newLocId) == 0)
                        {
                            _game.Map[i][j] = newLoc.GetComponent <Location>();
                        }
                        else if (_game.CheckType(newLocId) == 1)
                        {
                            _game.Map[i][j]     = newLoc.GetComponent <Location>();
                            _game.Map[i][j + 1] = newLoc.GetComponent <Location>();
                        }
                        else if (_game.CheckType(newLocId) == 2)
                        {
                            _game.Map[i][j]     = newLoc.GetComponent <Location>();
                            _game.Map[i + 1][j] = newLoc.GetComponent <Location>();
                        }

                        _game.Map[i][j].Initialize(new Index(i, j));
                        _game.Map[i][j].AncoredPos = new Vector3(gameData.LocData[i][j].LocPos.X, gameData.LocData[i][j].LocPos.Y, gameData.LocData[i][j].LocPos.Z);
                        _game.Map[i][j].Lose();

                        //_game.Map[i][j].Reclaimed = gameData.LocData[i][j].Reclaimed;
                        _game.Map[i][j].SurvPres.Clear();
                        _game.Map[i][j].SpotSurv.Clear();

                        foreach (SurvivorData survData in gameData.LocData[i][j].LocSurvPres)
                        {
                            GameObject newGameObj = GameObject.Instantiate(Resources.Load("Prefabs/Survivors/" + survData.Specialisation)) as GameObject;
                            newGameObj.transform.SetParent(_game.Map[i][j].transform);
                            newGameObj.GetComponent <Survivor>().Initialize(survData.Id, _game);
                            newGameObj.GetComponent <Survivor>().AncoredPos = new Vector3(0, 0, 0);
                            newGameObj.SetActive(false);
                            _game.Map[i][j].SurvPres.Add(newGameObj.GetComponent <Survivor>());
                        }

                        foreach (SurvivorData survData in gameData.LocData[i][j].LocSpotSurvPres)
                        {
                            GameObject newGameObj = GameObject.Instantiate(Resources.Load("Prefabs/Survivors/" + survData.Specialisation)) as GameObject;
                            newGameObj.transform.SetParent(_game.Map[i][j].transform);
                            newGameObj.GetComponent <Survivor>().Initialize(survData.Id, _game);
                            newGameObj.GetComponent <Survivor>().AncoredPos = new Vector3(0, 0, 0);
                            newGameObj.SetActive(false);
                            _game.Map[i][j].SpotSurv.Add(newGameObj.GetComponent <Survivor>());
                        }
                    }
                }
            }

            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    if (!_game.Map[i][j].NeighboursAttached)
                    {
                        _game.Map[i][j].UpdateNeighbours();
                    }
                }
            }

            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    if (gameData.LocData[i][j].Reclaimed)
                    {
                        _game.Map[i][j].Reclaim();
                    }
                }
            }

            for (int i = 0; i < gameData.SurvData.Count; i++)
            {
                GameObject newGameObj = GameObject.Instantiate(Resources.Load("Prefabs/Survivors/" + gameData.SurvData[i].Specialisation)) as GameObject;
                newGameObj.GetComponent <Survivor>().Initialize(gameData.SurvData[i].Id, _game);

                _game.AddSurvivor(newGameObj.GetComponent <Survivor>());
                _game.Survivors[i].Status = gameData.SurvData[i].Status;
            }

            for (int i = 0; i < gameData.DefenseSurvId.Count; i++)
            {
                _game.DefenseSurv.Add(_game.Survivors.Find(s => s.Id == gameData.DefenseSurvId[i]));
            }

            for (int i = 0; i < gameData.ActMissionData.Count; i++)
            {
                var missionType = GetMissionType(gameData.ActMissionData[i].Name);
                if (missionType != null)
                {
                    Mission newMission = (Mission)System.Activator.CreateInstance(missionType);
                    for (int n = 0; n < 10; n++)
                    {
                        for (int m = 0; m < 10; m++)
                        {
                            if (gameData.ActMissionData[i].CurLocId == _game.Map[n][m].Id)
                            {
                                newMission.Initialize(_game.Map[n][m]);
                                n = 10;
                                break;
                            }
                        }
                    }
                    _game.ActiveMissions.Add(newMission);
                }
                else
                {
                    Debug.Log("Mission at " + gameObject.name + " not found");
                }
            }

            foreach (Survivor surv in _game.Survivors)
            {
                if (surv.Status != "Idle")
                {
                    surv.Lock();
                }
            }

            _game.CurLocId             = gameData.CurLocId;
            _game.CurMissionId         = gameData.CurMissionId;
            _game.MapSize              = gameData.MapSize;
            _game.Days                 = gameData.Days;
            _game.IdleSurv             = gameData.IdleSurv;
            _game.LivingSpace          = gameData.LivingSpace;
            _game.Food                 = gameData.Food;
            _game.Happiness            = gameData.Happiness;
            _game.Defense              = gameData.Defense;
            _game.DefenseFromBuildings = gameData.DefenseFromBuildings;
            _game.FoodExtraction       = gameData.FoodExtraction;
            _game.FoodIntake           = gameData.FoodIntake;

            Debug.Log("Loaded");
        }
    }
Exemplo n.º 53
0
 void Bullet_effect_tag()
 {
     if (Physics.Raycast(transform.position, transform.forward, out hit, max_distance, ~ignore_layer))
     {
         ray_num++;
         if (hit_wall_decal)
         {
             print("레이캐스트 : " + hit.transform.tag);
             //print("레이캐스트 갯수 : " + ray_num);
             if (hit.transform.tag == "Enemy")
             {
                 Instantiate(blood_effect, hit.point, Quaternion.LookRotation(hit.normal));
                 hit.transform.gameObject.GetComponent <Enemy_control>().enemy_hp -= GameData.bullet_damage;
                 Destroy(gameObject);
             }
             else if (hit.transform.tag == "Goto_market")
             {
                 GameData.store_running = true;
             }
             else if (hit.transform.tag == "Next_stage")
             {
                 GameData.is_next_stage = true;
             }
             else if (hit.transform.tag == "Uzi")
             {
                 GameData.is_fire       = false;
                 GameData.buy_order_uzi = true;
             }
             else if (hit.transform.tag == "AK-47")
             {
                 GameData.is_fire      = false;
                 GameData.buy_order_ak = true;
             }
             else if (hit.transform.tag == "Spase-12")
             {
                 GameData.is_fire         = false;
                 GameData.buy_order_spase = true;
             }
             else if (hit.transform.tag == "Repair")
             {
                 GameData.buy_order_repair = true;
             }
             else if (hit.transform.tag == "Upgrade")
             {
                 if (ray_num < 2)
                 {
                     GameData.buy_order_upgrade = true;
                 }
             }
             else if (hit.transform.tag == "Goto_main")
             {
                 GameData.init();
                 Enemy_manager.ResetCreatures();
                 GameObject.FindWithTag("MainCamera").gameObject.GetComponent <Grayscale>().enabled = false;
                 SceneManager.LoadScene("Start_Scene");
             }
             else if (hit.transform.tag == "Retry")
             {
                 GameData.init();
                 Enemy_manager.ResetCreatures();
                 GameObject.FindWithTag("MainCamera").gameObject.GetComponent <Grayscale>().enabled = false;
                 SceneManager.LoadScene("Game_Scene");
             }
             else if (hit.transform.tag == "Start")
             {
                 //SceneManager.LoadScene("Game_Scene");
                 SceneManager.LoadScene("Game_Scene");
             }
             else if (hit.transform.tag == "Exit")
             {
                 print("종료");
                 Application.Quit();
             }
             else if (hit.transform.tag == "Invirment" || hit.transform.tag == "Fence_up" || hit.transform.tag == "Fence_down" || hit.transform.tag == "Fence_right" || hit.transform.tag == "Fence_left")
             {
                 Instantiate(hit_wall_decal, hit.point + hit.normal * infront_wall, Quaternion.LookRotation(hit.normal));
                 Destroy(gameObject);
             }
         }
         Destroy_bullet();
     }
     Destroy_bullet();
 }
Exemplo n.º 54
0
    private void KeyInput()
    {
        if (Input.anyKeyDown)
        {
            activeInput = true;
            SoundManager.instance.PlayingSound("footstep");
        }
        if (Input.GetKey(KeyCode.A))
        {
            lastPressed = "a";
            state       = State.Move;
            Left();
            activeInput = false;
        }
        else if (Input.GetKey(KeyCode.D))
        {
            lastPressed = "d";
            state       = State.Move;
            Right();
            activeInput = false;
        }
        else if (Input.GetKey(KeyCode.W))
        {
            lastPressed = "w";
            state       = State.Move;
            Up();
            activeInput = false;
        }
        else if (Input.GetKey(KeyCode.S))
        {
            lastPressed = "s";
            state       = State.Move;
            Down();
            activeInput = false;
        }
        else if (Input.GetKey(KeyCode.L))
        {
            lastPressed = "L";
        }
        else if (Input.GetKey(KeyCode.I))
        {
            if (lastPressed.Equals("L"))
            {
                lastPressed = "LI";
            }
        }
        else if (Input.GetKey(KeyCode.U))
        {
            if (lastPressed.Equals("LI"))
            {
                lastPressed = "LIU";
                if (GameMaster.isGodMode == true)
                {
                    GameMaster.isGodMode = false;
                    Debug.Log("God Mode Disable");
                    InitialSpeed = GameData.getPlayerInitialSpeed();
                }
                else
                {
                    GameMaster.isGodMode = true;
                    Debug.Log("God Mode Enable");
                    InitialSpeed = 20;
                }
            }
        }

        if (activeInput)
        {
            if (Input.GetKey(KeyCode.Space))
            {
                Shot();
                activeInput = false;
            }
        }
    }
Exemplo n.º 55
0
 public void ResetAllStatus()
 {
     PlayerPrefs.SetInt("FirstTime", 0); // Se ve también el tutorial la próxima vez que se inicia
     SaveGame(new GameData(allAreas));
     gameData = LoadGame();
 }
Exemplo n.º 56
0
        public override void PopulateData(RowParser parser, GameData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            ContentEntry = parser.ReadColumn <uint>(0);
        }
Exemplo n.º 57
0
 public void SaveGame(GameData gameData)
 {
     saveManager.SaveGame(gameData);
 }
Exemplo n.º 58
0
        public override void PopulateData(RowParser parser, GameData gameData, Language language)
        {
            base.PopulateData(parser, gameData, language);

            WeeklyLimit = parser.ReadColumn <ushort>(0);
        }
Exemplo n.º 59
0
    private void CheckEntered()
    {
        string text = GetEnterValue();

        if (text.Equals(expectedResult))
        {
            inputBG.sprite  = ANSWER_RIGHT_BG;
            inputText.color = GREEN;

            if (gameType == GameData.STORY_GAME_TYPE)
            {
                SetScoreValue(scoreValue - 1);

                if (scoreValue == 0)
                {
                    LevelDone();
                    return;
                }
            }
            else if (gameType == GameData.TIME_ATTACK_GAME_TYPE)
            {
                SetScoreValue(scoreValue + 1);
                SetTimerValue(timeLeft + 2);
                ShowBonus(2);
            }
            else
            {
                throw new System.Exception("gameType: " + gameType);
            }

            WaitAndGenerate();
        }
        else
        {
            if (expectedResult.Contains(MINUS))
            {
                if (text.Contains(MINUS))
                {
                    if (expectedResult.Length <= text.Length)
                    {
                        Handheld.Vibrate();
                        if (GameData.IsStoryMode())
                        {
                            SetTimerValue(timeLeft + 1);
                            ShowBonus(1);
                        }
                        else if (GameData.IsTimeAttackMode())
                        {
                            SetTimerValue(timeLeft - 1);
                            ShowBonus(-1);
                        }
                        else
                        {
                            throw new System.Exception("gameType: " + gameType);
                        }

                        WaitAndSetGreen();
                    }
                }
            }
            else if (!text.Contains(MINUS))
            {
                if (expectedResult.Length <= text.Length)
                {
                    Handheld.Vibrate();
                    if (GameData.IsStoryMode())
                    {
                        SetTimerValue(timeLeft + 1);
                        ShowBonus(1);
                    }
                    else if (GameData.IsTimeAttackMode())
                    {
                        SetTimerValue(timeLeft - 1);
                        ShowBonus(-1);
                    }
                    else
                    {
                        throw new System.Exception("gameType: " + gameType);
                    }

                    WaitAndSetGreen();
                }
            }
            else
            {
                if (expectedResult.Length + 1 <= text.Length)
                {
                    Handheld.Vibrate();
                    if (GameData.IsStoryMode())
                    {
                        SetTimerValue(timeLeft + 1);
                        ShowBonus(1);
                    }
                    else if (GameData.IsTimeAttackMode())
                    {
                        SetTimerValue(timeLeft - 1);
                        ShowBonus(-1);
                    }
                    else
                    {
                        throw new System.Exception("gameType: " + gameType);
                    }

                    WaitAndSetGreen();
                }
            }
        }
    }
Exemplo n.º 60
0
 private void Start()
 {
     gameData     = GameObject.Find("SceneLoader").GetComponent <GameData>();
     matrix       = GameObject.Find("Matrix");
     MatrixSlider = matrix.transform.GetComponentInChildren <Slider>();
 }