private void OnEnable() { Once = false; TheManager = FindObjectOfType <GameManagment>(); TheManager.Load(); ClearUI(); if (TheManager.ReturnPlayerRunes().Count > 0) { Once = true; } if (Once) { TheManager.Load(); TheManager.LoadRuneIn(); TheManager.GetAllRunes(); GenerateRuneButtons(); } else { GenerateRuneButtons(); FirstTimeRunePanel.SetActive(true); } }
// Update is called once per frame void Update() { // check if canvas is up in the shop, if so spawn arrow if not spawned already if (ani.GetCurrentAnimatorStateInfo(0).IsName("CamUp") && !arrow) { arrow = Instantiate(arrowPrefab, GameObject.Find("MenuCanvas").transform); Button arrowbtn = arrow.GetComponent <Button>(); GameManagment gm = GameObject.Find("GameManager").GetComponent <GameManagment>(); arrowbtn.onClick.AddListener(gm.StopShop); print(arrowbtn.onClick.ToString()); } // if arrowDestroy animation ended, destroy arrow if (arrow && arrow.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).IsName("ArrowEnd")) { Destroy(arrow); } if (endingGame) { StopGame(); } if (Input.GetKeyDown(KeyCode.Q)) { StartGame(); } }
void Start() { //Find the GameManager Object and get the GameManagement Script gameManagementObj = GameObject.FindGameObjectWithTag("GameManager"); gameManagement = gameManagementObj.GetComponent <GameManagment>(); //only change the panel number if is not set to 20. Means the game won't load into certain panels. if (panelnumber != 20) { gameManagement.currentPanel = panelnumber; } panelAnimations = 1; //Find the Main Canvas so we can set that as the Parent when introducing new Panels maincanvas = GameObject.FindGameObjectWithTag("MainCanvas"); //Set Open position so it is off Screen OpenPosition = new Vector3(-3000, 0, 0); //set for the startscreen so it doesnt slide in intially if (spawn == true) { LeanTween.moveLocal(this.gameObject, new Vector3(0, 0, 0), speed).setEaseInOutBack(); } // If the panel that this script is attached to has addweek set to true then get the gamemanagment script and add a week to the counter if (addweek == true) { gameManagement.addweek(); } }
private void OnEnable() { Once = false; ClearUI(); TheManager = FindObjectOfType <GameManagment>(); TheManager.Load(); if (TheManager.ReturnPlayerMonsters().Count > 0) { Once = true; } if (Once) { TheManager.Load(); TheManager.LoadInMonsterName(); TheManager.GetAllMonsters(); GenerateMonsterButtons(); } else { MonsterBiengUsed = null; FirstTimePanelMonster.SetActive(true); GenerateMonsterButtons(); } }
// Start is called before the first frame update void Start() { Gamemanager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); PlayerNum = 0; ChangeTitle(); }
// Start is called before the first frame update void Start() { gameManagment = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); player1.onClick.AddListener(() => playerselected(1)); player2.onClick.AddListener(() => playerselected(2)); player3.onClick.AddListener(() => playerselected(3)); player4.onClick.AddListener(() => playerselected(4)); player5.onClick.AddListener(() => playerselected(5)); }
// Use this for initialization void Start() { rBody = GetComponent <Rigidbody2D>(); properties = GetComponent <RabbitProperties>(); queuedLayers.Add((int)RabbitState.Move); currentState = RabbitState.Move; cooldown = 1f; gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); }
private void Start() { gmScript = GameManagment.instance; //Fills spawnPoints List for (int x = 0; x < transform.childCount; x++) { spawnPoints.Add(transform.GetChild(x)); SpawnCount++; } }
// Use this for initialization void Start() { rBody = GetComponent <Rigidbody2D>(); properties = GetComponent <RabbitProperties>(); queuedLayers.Add((int)RabbitState.Move); currentState = RabbitState.Move; cooldown = 1f; gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); //Debug.Log(gm); Debug.Log("Reminder: 0 = Attack, 1 = Mine, 2 = Move"); }
private int GetWinner(int firstPlayerId, int secondPlayerId) { if (GameManagment.Winner(GetBoardByPlayerId(firstPlayerId), GetBoardByPlayerId(secondPlayerId)) != null) { if (GameManagment.Winner(GetBoardByPlayerId(firstPlayerId), GetBoardByPlayerId(secondPlayerId)) == GetBoardByPlayerId(firstPlayerId)) { return(firstPlayerId); } if (GameManagment.Winner(GetBoardByPlayerId(firstPlayerId), GetBoardByPlayerId(secondPlayerId)) == GetBoardByPlayerId(secondPlayerId)) { return(secondPlayerId); } } return(0); }
/* * MoveCommand() * * constructor, specifies the target tile and callback * * @param Unit u - the unit that made this command * @param VoidFunc scb - the callback to use when finished * @param VoidFunc fcb - the callback to use when failed * @param Tiles st - the first tile selected * @param Tiles et - the last tile selected */ public MoveCommand(Unit u, VoidFunc scb, VoidFunc fcb, Tiles st, Tiles et, bool safeMove) : base(u, scb, fcb, st, et) { if (unit.ArtLink != null) { unit.ArtLink.SetBool("IsWalking", true); } //find the map component map = GameObject.FindObjectOfType <Map>(); //find the manager component m_manager = GameObject.FindObjectOfType <GameManagment>(); isSafeMove = safeMove; m_timer = m_waitTime; }
// Start is called before the first frame update void Start() { gamemanagementScript = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); gameManger = GameObject.FindGameObjectWithTag("GameManager"); addDropOptions(); numberofPlayers = gamemanagementScript.numberOfPlayers; List <string> m_DropOptions = new List <string> { Team1.text, Team2.text, Team3.text, Team4.text, Team5.text, Team6.text, Team7.text, Team8.text, Team9.text, Team10.text, Team11.text, Team12.text, Team13.text }; dropdown.ClearOptions(); dropdown.AddOptions(m_DropOptions); }
//Creates an instance that is perminant private void Awake() { if (Application.platform == RuntimePlatform.Android) { isAndroid = true; } if (instance != null) { Destroy(this); } else { instance = this; } DontDestroyOnLoad(this); }
public float kingBias = 20.0f; //additional points for select functions that make the king less aggressive and make the team revolve more around him // Use this for initialization new void Start() { isHuman = false; manager = Object.FindObjectOfType <GameManagment>(); map = Object.FindObjectOfType <Map>(); //the ai player hasn't been assigned a logic machine, it isn't being used if (logicMachine == null) { return; } logicMachine.input = GetComponent <ManagerInput>() as BaseInput; //get the size of the players list int playerSize = manager.players.Count; //iterate through all of the players for (int i = 0; i < playerSize; i++) { //store in a temp value for readability BasePlayer p = manager.players[i]; //check that the current player isn't this one if (p != this as BasePlayer) { opponent = p; break; } } FuzzyFunction advance = new FuzzyFunction(EvalAdvance, ExecAdvance); FuzzyFunction flee = new FuzzyFunction(EvalFlee, ExecFlee); FuzzyFunction attack = new FuzzyFunction(EvalAttack, ExecAttack); FuzzyFunction healing = new FuzzyFunction(EvalHeal, ExecHeal); FuzzyFunction effort = new FuzzyFunction(EvalEffort, ExecEffort); FuzzyFunction group = new FuzzyFunction(EvalGroup, ExecGroup); //add all fuzzy functions to the fuzzy logic machine logicMachine.functions.Add(advance); logicMachine.functions.Add(flee); logicMachine.functions.Add(attack); logicMachine.functions.Add(healing); logicMachine.functions.Add(effort); logicMachine.functions.Add(group); }
void Start() { manager = GameManagment.FindObjectOfType <GameManagment>(); ColorChangers = GameObject.FindGameObjectWithTag("RedVSBlue"); //Put an if on whose turn to determine default UI color spriteRender = ColorChangers.GetComponent <SpriteRender>(); if (manager.turn == 0) { spriteRender.isBlueTeam = true; } else { spriteRender.isBlueTeam = false; } }
public bool Attack(int targetId) { string X, Y; GameDisplayer.PrintEnterXAttackPoint(); X = GameDisplayer.Read(); GameDisplayer.PrintEnterYAttackPoint(); Y = GameDisplayer.Read(); Point pointToAttack = new Point(int.Parse(X) - 1, int.Parse(Y) - 1); if (GetBoardByPlayerId(targetId).PlayerBoard[pointToAttack.X, pointToAttack.Y]) { GameManagment.AttackUpdateBoard(GetPlayerById(targetId), pointToAttack); return(true); } else { return(false); } }
// Start is called before the first frame update void Start() { Gamemanager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); }
// Use this for initialization void Start() { Rabbit = null; gmMan = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagment>(); }
// Start is called before the first frame update void Start() { TheManager = FindObjectOfType <GameManagment>(); NoRuneUsed.gameObject.SetActive(true); RuneBiengUsed = null; }