Inheritance: MonoBehaviour
    // Use this for initialization
    void Start()
    {
        GameObject g = GameObject.Find ("GameManager");
        globalObj = g.GetComponent< GameManagerScript >();

        coinText = gameObject.GetComponent<Text> ();
    }
示例#2
0
 // Use this for initialization
 void Start()
 {
     birdState = BirdState.idle;
     gameManager = GameObject.FindGameObjectWithTag ("GM");
     gameManagerScript = gameManager.GetComponent<GameManagerScript> () as GameManagerScript;
     newPos = this.transform.position;
 }
    // Use this for initialization
    void Start()
    {
        var gameManager = GameObject.FindGameObjectWithTag("GameManager");
        m_GameManagerScript = gameManager.GetComponent<GameManagerScript>();

        m_audio = this.GetComponent<AudioSource>();
    }
示例#4
0
	// Use this for initialization
	void Start () {
		GameObject hudObject = GameObject.FindGameObjectWithTag("Player");
		GameObject managerObject = GameObject.FindGameObjectWithTag("GameController");
		
		gameManager = managerObject.GetComponent<GameManagerScript>();
		hudScript = hudObject.GetComponent<HUDScript>();
	}
示例#5
0
    // Use this for initialization
    void Start () {

        gm = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameManagerScript>();
        source = GetComponentInChildren<AudioSource>();
        rb = GetComponent<Rigidbody2D>();
        rend = GetComponentInChildren<Renderer>();
        circleCollider = GetComponent<CircleCollider2D>();
        letter = GetComponentInChildren<TextMesh>();

        char[] alphabet = "AABCDEEEFGHIIJKLMNOOPQRSTUVWXYZ".ToCharArray();
        int randomLetter = Random.Range(0, alphabet.Length);
        letter.text = alphabet[randomLetter].ToString();

        if ("AEIOU".Contains(letter.text))
        {
            letter.color = vowelColor;
        }
        
        timeToLive = Time.time + timeToLive;

        rb.drag = 0;

        float x = Random.Range(-1.0f, 1.0f);
        float y = Random.Range(-1.0f, 1.0f);
        int speed = Random.Range(50, 150);

        source.PlayOneShot(bubbleSpawn, .5f);
        rb.AddForce(new Vector2(x, y) * speed);
    }
示例#6
0
	// Use this for initialization
	void Start () {
		GameObject tutorialObject = GameObject.FindGameObjectWithTag("Tutorial");
		GameObject managerObject = GameObject.FindGameObjectWithTag("GameController");
		
		tutorial = tutorialObject.GetComponent<TutorialManagerScript>();
		gameManager = managerObject.GetComponent<GameManagerScript>();
	}
    void Awake()
    {
        current = this;
        numOfPlayer = PlayerPrefs.GetInt("player");

        switch (numOfPlayer)
        {
            case 0:
                player0.SetActive(true);
                player1.SetActive(false);

                break;
            case 1:
                player1.SetActive(true);
                player0.SetActive(false);

                break;

            default:
                break;
        }

        player = GameObject.FindWithTag("Player");
        playerController = player.GetComponent<PlayerController>();
        paused = false;
    }
 void Awake()
 {
     crosshair = moveCrosshair.Instance();
     gameManager = GameManagerScript.Instance();
     debounceCount = 0;
     Assert.IsTrue(crosshair && gameManager);
 }
 // Use this for initialization
 void Start()
 {
     var rb = GetComponent<Rigidbody> ();
     GameObject g = GameObject.Find ("GameManager");
     gameobj = g.GetComponent<GameManagerScript>();
     rb.velocity = new Vector3 (0, 0, gameobj.zSpeed);
     //		Debug.Log (gameobj.zSpeed);
 }
示例#10
0
    private GameManagerScript getGameManager()
    {
        if(gameManager == null) {
            gameManager = (GameManagerScript) GameObject.FindGameObjectWithTag("GameManager").GetComponent(typeof(GameManagerScript));
        }

        return gameManager;
    }
示例#11
0
	void Start()
	{
		Direction = Direction.South;
		Player = GameObject.FindWithTag("Player");
		EnemyScript = GetComponent<Enemy>();
		GM = GameObject.Find("GameManager").GetComponent<GameManagerScript>();
		renderer = GetComponent<SpriteRenderer>();
		renderer.sprite = firstSprite;
	}
 // Use this for initialization
 void Awake () {
     buttonPress = GameObject.Find("ButtonPress").GetComponent<AudioSource>();
     mainCamera = Camera.main;
     xScreen = Screen.width / 2;
     yScreen = Screen.height / 2;
     gameManager = GameManagerScript.Instance();
     start = Time.time;
     expectedTime = Time.time + 1;
 }
示例#13
0
	void Start()
    {
        GameObject gm = GameObject.FindGameObjectWithTag("Game Manager");
        map = gm.GetComponent<MapScript>();
        gms = gm.GetComponent<GameManagerScript>();
        Init();
        jumpTimer = new Timer(jumpTime, () => FinishJump());
        digTimer = new Timer(digTime, () => FinishDig());
        movePositionTimer = new Timer(movePositionTime, () => SetPosition());
	}
示例#14
0
	void Start () {
		Rigid = GetComponent<Rigidbody2D>();
		GM = GameObject.Find("GameManager").GetComponent<GameManagerScript>();
		if (AimAt != null)
		{
			AimAtPosition = AimAt.transform.position;
		}
		GetDirectionFromLauncher();
		Damage.Value = (float)Math.Round(Damage.Random, 2);
	}
示例#15
0
    // Use this for initialization
    void Start()
    {
        //zSpeed = -100;
        var rb = GetComponent<Rigidbody> ();
        rb.velocity = new Vector3 (0, 0, zSpeed);
        generate = true;

        GameObject g = GameObject.Find ("GameManager");
        gameManager = g.GetComponent<GameManagerScript>();
    }
示例#16
0
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.FindGameObjectWithTag ("GM");
     gameManagerScript = gameManager.GetComponent<GameManagerScript> () as GameManagerScript;
     newPos = this.transform.position;
     startingPos = this.transform.position;
     speed = Random.Range (2,6);
     sinPeak = Random.Range (0,4);
     sinFreq = Random.Range (0.1f, .6f);
 }
	// Use this for initialization
	void Awake () {
        rectTransform = GetComponent<RectTransform>();
        gameManager = GameManagerScript.Instance();
        if (!ARCamera)
            Debug.LogError("Need to attach AR Camera!");
        startParent = transform.parent;
        startLocalPosition = transform.localPosition;
        open = false;
        animate = false;
        startSizeDelta = rectTransform.sizeDelta;
    }
示例#18
0
	// Use this for initialization
	void Start () {
		if (Instance != null) {
			GameObject.Destroy (gameObject);
		} else 
		{
			GameObject.DontDestroyOnLoad (gameObject);
			Instance = this;
		}
	
	
	}
    // Use this for initialization
    void Start()
    {
        gameManagerScript = GetComponent<GameManagerScript> ();
        characterScript = GameObject.Find ("Character").GetComponent<CharacterScript> ();

        danceBar.value = initialValue;
        currentValue = initialValue;

        danceType = 1;
        tapCount = 0;
    }
示例#20
0
	void Start()
	{
		GM = GameObject.Find("GameManager").GetComponent<GameManagerScript>();
		Items = new Item[40];
		CurrentSlot = 0;
		for (int i = 0; i < Items.Length; i++)
		{
			Items[i] = GameManagerScript.Items[i];
		}
		InventoryObject = GameObject.Find("Inventory");
	}
示例#21
0
	void Start()
    {
        gms = GetComponent<GameManagerScript>();
        bms = GetComponent<BunnyManagerScript>();
        InitializeMap();
        if (randomLandMines)
        {
            RandomLandMines();
        }
        InitializeSpecialTiles();
        UpdateTileMineProximity();
	}
示例#22
0
	void Start()
	{
		Direction = Direction.South;
		Player = GameObject.FindWithTag("Player");
		EnemyScript = GetComponent<Enemy>();
		GM = GameObject.Find("GameManager").GetComponent<GameManagerScript>();
		GM.PriestNPC.GetComponent<NPC>().TextBox.clear();
		GM.PriestNPC.GetComponent<NPC>().TextBox.addText("Hm... It's seems you have beaten me...");
		GM.PriestNPC.GetComponent<NPC>().TextBox.addText("You may be safe for now, but know this: I will return to take over the world someday!");
		GM.PriestNPC.GetComponent<NPC>().TextBox.addText("Hahahahahaha!!!");
		GetComponent<SpriteRenderer>().sprite = sprite;
	}
示例#23
0
    void Start()
    {
        birdState = BirdState.idle;
        gameManager = GameObject.FindGameObjectWithTag("GM");
        gameManagerScript = gameManager.GetComponent<GameManagerScript>() as GameManagerScript;
        spriteRenderer = gameObject.GetComponent<SpriteRenderer>();

        gameManagerScript.SetBossName(bossName);
        gameManagerScript.SetHPBar(Health);

        newPos = this.transform.position;
    }
示例#24
0
 void Awake()
 {
     if (!manager)
     {
         manager = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#25
0
    public void InitValues(int IndexInScrollList, MissionScript newMission)
    {
        btnIndex = IndexInScrollList;
        mission = newMission;

        nameTxtObj = Instantiate(TextPrefab, new Vector3(30, -10, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        nameTxtObj.transform.SetParent(this.gameObject.transform, false);
        nameTxt = nameTxtObj.GetComponent<Text>();

        typeTxtObj = Instantiate(TextPrefab, new Vector3(30, -50, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        typeTxtObj.transform.SetParent(this.gameObject.transform, false);
        typeTxt = typeTxtObj.GetComponent<Text>();

        timeTxtObj = Instantiate(TextPrefab, new Vector3(250, -10, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        timeTxtObj.transform.SetParent(this.gameObject.transform, false);
        timeTxt = timeTxtObj.GetComponent<Text>();

        difficultyTxtObj = Instantiate(TextPrefab, new Vector3(170, -50, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        difficultyTxtObj.transform.SetParent(this.gameObject.transform, false);
        difficultyTxt = difficultyTxtObj.GetComponent<Text>();

        xpTxtObj = Instantiate(TextPrefab, new Vector3(250, -50, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        xpTxtObj.transform.SetParent(this.gameObject.transform, false);
        xpTxt = xpTxtObj.GetComponent<Text>();

        moneyTxtObj = Instantiate(TextPrefab, new Vector3(320, -50, 0), new Quaternion(0, 0, 0, 0)) as GameObject;
        moneyTxtObj.transform.SetParent(this.gameObject.transform, false);
        moneyTxt = moneyTxtObj.GetComponent<Text>();

        ActionBtnObj = this.gameObject;
        ActionBtn = ActionBtnObj.GetComponent<Button>();
        if (mission.GetMissionState() == MissionScript.MissionState.Completed || mission.GetMissionState() == MissionScript.MissionState.Failed)
        {
            ActionBtn.onClick.AddListener(() => gameManagerScript.TurnInMission(btnIndex));
        } else {
            ActionBtn.onClick.AddListener(() => gameManagerScript.SelectMission(btnIndex));
        }

        nameTxt.text = mission.GetMissionName();
        typeTxt.text = mission.GetMissionType().ToString();

        float temp = Mathf.Round(mission.GetTimeRemaining());
        if (temp == 0) { timeTxt.text = mission.GetMissionState().ToString(); }
        else { timeTxt.text = temp.ToString() + " seconds"; }

        difficultyTxt.text = mission.GetDifficulty().ToString();
        xpTxt.text = mission.GetXP().ToString() + "xp";
        moneyTxt.text = "£" + mission.GetMoney().ToString();

        GameManager = GameObject.FindGameObjectWithTag("GameManager");
        gameManagerScript = GameManager.GetComponent<GameManagerScript>();
    }
	// Use this for initialization
	void Awake () {
        // Initialize our references
        platformRenderer = HelperMethods.FindChildWithName(gameObject, "PlatformMesh").transform;
        DescentTarget = HelperMethods.FindChildWithName(gameObject, "DescentTarget").transform;
        AscentTarget = HelperMethods.FindChildWithName(gameObject, "AscentTarget").transform;
        gameManager = GameManagerScript.Instance();
        ARCameraTransform = GameObject.Find("ARCamera").transform;
        Assert.IsTrue(DescentTarget && AscentTarget && gameManager);

        // Detach the targets so they are in world space
        AscentTarget.SetParent(null);
        DescentTarget.SetParent(null);
	}
示例#27
0
 void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Beam") {
         DestroyObject(collision.gameObject);
         if (gameManagerScript != null) gameManagerScript.EnemyDied(5);
         else {
             Debug.Log("AngryBee, no GM");
             gameManager = GameObject.FindGameObjectWithTag("GM");
             gameManagerScript = gameManager.GetComponent<GameManagerScript>() as GameManagerScript;
         }
         DestroyObject(this.gameObject);
     }
 }
	void Awake()
    {
        if (instance == null)  // if no previous manager
        {
            instance = this;
        } else if (instance != this) // if manager already exists dont make another
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);// makes this not die when a new scene is loaded
        boardScript = GetComponent<BoardManager>();
        InitGame();
    }
    void Awake()
    {
        platformsList = new List<FloatingPlatform>();
        IEnumerable childPlatforms = GetComponentsInChildren<FloatingPlatform>();
        gameManager = GameManagerScript.Instance();

        foreach (FloatingPlatform platform in childPlatforms) {
            platformsList.Add(platform);
            platform.acceleration = acceleration;
        }
        pauseButton = GameObject.FindObjectOfType<PauseButton>();

        Assert.IsTrue(gameManager);
    }
示例#30
0
 void Awake()
 {
     //AudioManagerインスタンスが存在したら
     if (instance != null) {
         //今回インスタンス化したAudioManagerを破棄
         Destroy(this.gameObject);
     //AudioManagerインスタンスがなかったら
     } else if (instance == null){
         //このAudioManagerをインスタンスとする
         instance = this;
     }
     //シーンを跨いでもAudioManagerインスタンスを破棄しない
     DontDestroyOnLoad (this.gameObject);
 }
示例#31
0
        private void GetResults()
        {
            bool finalPositionFound = false;

            SuccessfullMovementProgress = 0;
            ObstaclesStayDetector lastShipBumpDetector = null;

            for (int i = generatedShipStands.Length - 1; i >= 0; i--)
            {
                ObstaclesStayDetector obstacleStayDetector = generatedShipStands[i].GetComponentInChildren <ObstaclesStayDetector>();
                ObstaclesHitsDetector obstacleHitsDetector = generatedShipStands[i].GetComponentInChildren <ObstaclesHitsDetector>();

                if (!finalPositionFound)
                {
                    if (obstacleStayDetector.OverlapsShip)
                    {
                        lastShipBumpDetector = obstacleStayDetector;
                    }
                    else
                    {
                        IsOffTheBoard               = obstacleStayDetector.OffTheBoard;
                        LandedOnObstacles           = new List <GenericObstacle>(obstacleStayDetector.OverlapedAsteroids);
                        SuccessfullMovementProgress = (float)(i) / (generatedShipStands.Length - 1);

                        if (lastShipBumpDetector != null)
                        {
                            foreach (var overlapedShip in lastShipBumpDetector.OverlapedShips)
                            {
                                if (!ShipsBumped.Contains(overlapedShip))
                                {
                                    ShipsBumped.Add(overlapedShip);
                                }
                            }
                        }

                        foreach (var asteroidHit in obstacleStayDetector.OverlapedAsteroids)
                        {
                            if (!AsteroidsHit.Contains(asteroidHit))
                            {
                                AsteroidsHit.Add(asteroidHit);
                            }
                        }

                        foreach (var mineHit in obstacleStayDetector.OverlapedMines)
                        {
                            GameObject MineObject = mineHit.transform.parent.gameObject;
                            if (!MinesHit.Contains(MineObject))
                            {
                                MinesHit.Add(MineObject);
                            }
                        }

                        finalPositionFound = true;
                        //break;
                    }
                }
                else
                {
                    foreach (GenericObstacle asteroidHit in obstacleHitsDetector.OverlapedAsteroids)
                    {
                        if (!AsteroidsHit.Contains(asteroidHit))
                        {
                            AsteroidsHit.Add(asteroidHit);
                        }
                    }
                    foreach (var mineHit in obstacleHitsDetector.OverlapedMines)
                    {
                        GameObject MineObject = mineHit.transform.parent.gameObject;
                        if (!MinesHit.Contains(MineObject))
                        {
                            MinesHit.Add(MineObject);
                        }
                    }
                }
            }

            Selection.ThisShip.ToggleColliders(true);

            if (!DebugManager.DebugMovement)
            {
                DestroyGeneratedShipStands();
                CallBack();
            }
            else
            {
                GameManagerScript.Wait(2, delegate { DestroyGeneratedShipStands(); CallBack(); });
            }
        }
示例#32
0
 private void Start()
 {
     gm = GameManagerScript.instance();
 }
示例#33
0
 // Start is called before the first frame update
 void Start()
 {
     this.toggleTileFace();
     gm = FindObjectOfType <GameManagerScript>();
 }
示例#34
0
 void Awake()
 {
     LoadGameScores();
     GameManagerScript.ResetPlayersScore();
 }
示例#35
0
    // Start is called before the first frame update
    void Start()
    {
        // Define variables

        GM_Script = GameObject.Find("GameManager").GetComponent <GameManagerScript>();
    }
示例#36
0
        public virtual void LaunchShipMovement()
        {
            GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>();

            Game.Wait(0.5f, delegate { TheShip.StartMoving(LaunchShipMovementContinue); });
        }
示例#37
0
 public virtual void AttachToShip(Ship.GenericShip host)
 {
     Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>();
     Host = host;
 }
 private void Awake()
 {
     current = this;
 }
示例#39
0
 public void Start()
 {
     lastStunned = -GameManagerScript.GetInstance().playerStunLength;
 }
示例#40
0
    GameManagerScript gameManagerScript;                           //取得したGameManagerScriptを格納しておく為の変数



    void Start()
    {
        gameManagerScript = gameManager.GetComponent <GameManagerScript>();//gameManagerにくっついているGameManagerScriptを取得→変数gameManagerScriptに格納
    }
示例#41
0
 // Start is called before the first frame update
 void Start()
 {
     GameManagerScript = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManagerScript>();
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     //if (collision == GameObject.Find("Player"))
     GameManagerScript.TransitionScene(sceneNameToTransitionTo);
     Debug.Log("Trigger Working");
 }
示例#43
0
 // Use this for initialization
 private void Awake()
 {
     GameManager = GameObject.Find("Game Manager")
                   .GetComponent <GameManagerScript>();
     _frameCounter = 0;
 }
示例#44
0
 // Use this for initialization
 void Start()
 {
     numAboveLine = 0;
     currentTime  = maxTime;
     gameManager  = GameObject.Find("GameManager").GetComponent <GameManagerScript> ();
 }
    private bool checkForSwipeCompletion(TKTouch touch)
    {
        // if we have a time stipulation and we exceeded it stop listening for swipes, fail
        if (timeToSwipe > 0.0f && (Time.time - this._startTime) > timeToSwipe)
        {
            return(false);
        }

        // if we don't have at least two points to test yet, then fail
        if (this._points.Count < 2)
        {
            return(false);
        }

        // the ideal distance in pixels from the start to the finish
        float idealDistance = Vector2.Distance(startPoint, endPoint);

        // the ideal distance in centimeters, based on the screen pixel density
        float idealDistanceCM = idealDistance / TouchKit.instance.ScreenPixelsPerCm;

        // if the distance moved in cm was less than the minimum,
        if (idealDistanceCM < this._minimumDistance || idealDistanceCM > this._maximumDistance)
        {
            return(false);
        }

        // add up distances between all points sampled during the gesture to get the real distance
        float realDistance = 0f;

        for (int i = 1; i < this._points.Count; i++)
        {
            realDistance += Vector2.Distance(this._points[i], this._points[i - 1]);
        }

        // if the real distance is 10% greater than the ideal distance, then fail
        // this weeds out really irregular "lines" and curves from being considered swipes
        if (realDistance > idealDistance * 1.1f)
        {
            return(false);
        }

        // the speed in cm/s of the swipe
        swipeVelocity = idealDistanceCM / (Time.time - this._startTime);

        // turn the slope of the ideal swipe line into an angle in degrees
        Vector2 v2         = (endPoint - startPoint).normalized;
        float   swipeAngle = Mathf.Atan2(v2.y, v2.x) * Mathf.Rad2Deg;

        if (swipeAngle < 0)
        {
            swipeAngle = 360 + swipeAngle;
        }
        swipeAngle = 360 - swipeAngle;

        // depending on the angle of the line, give a logical swipe direction

        /*
         *      if( swipeAngle >= 292.5f && swipeAngle <= 337.5f )
         *              completedSwipeDirection = TKSwipeDirection.UpRight;
         *      else if( swipeAngle >= 247.5f && swipeAngle <= 292.5f )
         *              completedSwipeDirection = TKSwipeDirection.Up;
         *      else if( swipeAngle >= 202.5f && swipeAngle <= 247.5f )
         *              completedSwipeDirection = TKSwipeDirection.UpLeft;
         *      else if( swipeAngle >= 157.5f && swipeAngle <= 202.5f )
         *              completedSwipeDirection = TKSwipeDirection.Left;
         *      else if( swipeAngle >= 112.5f && swipeAngle <= 157.5f )
         *              completedSwipeDirection = TKSwipeDirection.DownLeft;
         *      else if( swipeAngle >= 67.5f && swipeAngle <= 112.5f )
         *              completedSwipeDirection = TKSwipeDirection.Down;
         *      else if( swipeAngle >= 22.5f && swipeAngle <= 67.5f )
         *              completedSwipeDirection = TKSwipeDirection.DownRight;
         *      else // swipeAngle >= 337.5f || swipeAngle <= 22.5f
         *              completedSwipeDirection = TKSwipeDirection.Right;
         */
        GameManagerScript gameManager = GameObject.Find("GameManager").GetComponent <GameManagerScript>();

        //swipeAngle = 0 is 3 o'Clock or East or arcos(1)

        if (swipeAngle >= 120f && swipeAngle <= 240f)
        {
            completedSwipeDirection = TKSwipeDirection.Left;
            gameManager.LeftDecision();
        }

        else if (swipeAngle >= 300f || swipeAngle <= 60f)
        {
            completedSwipeDirection = TKSwipeDirection.Right;
            gameManager.RightDecision();
        }

        else if (swipeAngle >= 240f || swipeAngle <= 300f)
        {
            completedSwipeDirection = TKSwipeDirection.Up;
            gameManager.StraightDecision();
            //ENABLE A POWER UP IF PLAYER HAS ONE
        }

        return(true);
    }
 // Use this for initialization
 void Awake()
 {
     GMS = GameObject.Find("GameManager").GetComponent <GameManagerScript> ();
     GMS.cur_coins++;
 }
 // Start is called before the first frame update
 void Start()
 {
     gameManagerScript = GameObject.Find("GameManager").GetComponent <GameManagerScript>();
     GetComponent <Button>().onClick.AddListener(callCharacter);
 }
示例#48
0
    private GameManagerScript gameManager;  //reference to the game manager script

    // Use this for initialization
    void Start()
    {
        gameManager = FindObjectOfType <GameManagerScript>();
    }
示例#49
0
 // Start is called before the first frame update
 void Start()
 {
     OxygenBar         = GetComponent <Slider>();
     OxygenTextDisplay = GetComponent <Text>();
     GMScript          = GameObject.Find("GameManager").GetComponent <GameManagerScript>();
 }
示例#50
0
    // Use this for initialization

    void Start()
    {
        gameManager = GameObject.Find("GameManager").GetComponent <GameManagerScript> ();
        audioSource = gameObject.GetComponent <AudioSource> ();
    }
示例#51
0
 // Use this for initialization
 void Start()
 {
     mainGameScript = GameObject.Find("GameManagerObj").GetComponent <GameManagerScript>();
 }
 public virtual void Start()
 {
     gameManager = GetComponent <GameManagerScript>();
 }
 public void updateUI()
 {
     GetComponentInChildren <TextMesh>().text = "Damage : " + (int)attackToSend + "\nSpeed : " + (int)attackSpeedToSend + "\nRange : " + (int)rangeToSend + "\nCoins per wave : " + moneyToSend + "\nExplosion diameter : " + aoeToSend + "\nCritical chance : " + critToSend + "\nPoison : " + poisonToSend;
     GameManagerScript.calculateIncomePerTurn();
 }
示例#54
0
    private void PlacePlatesInCircle()
    {
        List <Player> players = mRestaurantScript.getAlivePlayers();

        float distanceBetweenAngle = 360.0f / players.Count;

        //Have the current player be at the bottom so it's closest to the user.
        float currentAngle = 270.0f;

        //Scale radius by screen size to keep it consistent.
        float radius = mCanvas.pixelRect.width / 4.2f;

        int i;

        for (i = 0; i < players.Count; ++i)
        {
            Button userPlate = Instantiate(mPlatePrefab, mTableCenter.transform);

            Player currentPlayer = players [i];

            //adds triggers to the plates that allows the code to know when the button is held
            EventTrigger       eventTrigger = userPlate.gameObject.AddComponent <EventTrigger> () as EventTrigger;
            EventTrigger.Entry downEntry    = new EventTrigger.Entry();
            EventTrigger.Entry upEntry      = new EventTrigger.Entry();
            downEntry.eventID = EventTriggerType.PointerDown;
            downEntry.callback.AddListener((eventData) => { GameManagerScript.GetInstance().GetComponent <RestaurantScript>().ClickPlateDown(); });
            upEntry.eventID = EventTriggerType.PointerUp;
            upEntry.callback.AddListener((eventData) => { GameManagerScript.GetInstance().GetComponent <RestaurantScript>().ClickPlateUp(currentPlayer); });
            eventTrigger.triggers.Add(downEntry);
            eventTrigger.triggers.Add(upEntry);

            //userPlate.onClick.AddListener(delegate { GameManagerScript.GetInstance().GetComponent<RestaurantScript>().ClickPlate(currentPlayer); });
            //userPlate.transform.GetChild(0).GetComponent<Text>().text = players[i].getName();

            Vector3 pos = mTableCenter.transform.position;

            pos.x += radius * Mathf.Cos(Mathf.Deg2Rad * currentAngle);
            pos.y += radius * Mathf.Sin(Mathf.Deg2Rad * currentAngle);

            userPlate.transform.position = pos;

            Vector3 rot = userPlate.transform.eulerAngles;

            if ((currentAngle > 270 && currentAngle < 360) || (currentAngle < 90 && currentAngle > 0))
            {
                rot.z = currentAngle;
            }
            else if (currentAngle > 90 && currentAngle < 270)
            {
                rot.z = currentAngle - 180;
            }

            userPlate.transform.eulerAngles = rot;

            currentAngle = ((currentAngle + distanceBetweenAngle) % 360);

            mPlayerMeals.Add(userPlate);
            //GameManagerScript.GetInstance ().GetComponent<RestaurantScript> ().addMeal (mealForPlate);
        }

        //mTurnManagerScript.setPlayerMeals(mPlayerMeals);
    }
 // Use this for initialization
 void Start()
 {
     player          = GameObject.FindWithTag("Player");
     uiManagerScript = uiManager.GetComponent <UIManagerScript> ();
     gameManager     = GameObject.FindWithTag("GameManager").GetComponent <GameManagerScript> ();
 }
示例#56
0
 // Use this for initialization
 void Start()
 {
     gameManagerScript = GameObject.Find("GameManager").GetComponent <GameManagerScript> ();
 }
示例#57
0
 void Start()
 {
     Current        = this;
     Time.timeScale = 1;
     LevelCanvas.SetActive(false);
 }
示例#58
0
        public override void InformAboutCrit()
        {
            base.InformAboutCrit();

            GameManagerScript.Wait(3, InformCrit.ButtonConfirm);
        }
示例#59
0
 void Start()
 {
     GM = GameObject.Find("GameManager").GetComponent <GameManagerScript>();
     UC = GameObject.Find("Upgrade_UI").GetComponent <UpgradeController>();
 }
示例#60
0
 void Start()
 {
     mRestaurantScript = GameManagerScript.GetInstance().GetComponent <RestaurantScript>();
 }