Наследование: MonoBehaviour
Пример #1
0
    void Start()
    {
        player = gameObject.GetComponentInParent<Player>();


        if (GameObject.FindGameObjectWithTag("GameMaster") != null)
            gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<gameMaster>();
    }
Пример #2
0
	// Use this for initialization
	void Start () {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
        weapon_beam = GameObject.Find("weapon_beam").GetComponent<Transform>();
        weapon_beam_anim = GameObject.Find("weapon_beam").GetComponent<Animator>();
        weapon_beam_collider = GameObject.Find("weapon_beam").GetComponent<BoxCollider2D>();
        enemy = GameObject.FindGameObjectsWithTag("Enemy");

        if (GameObject.FindGameObjectWithTag("GameMaster") != null)
            gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<gameMaster>();
    }
Пример #3
0
    // Use this for initialization
    void Start () {
		speed = 4f;
		dampingFactor = 0.93f;
		dampingThreshold = 0.1f;
		maxSpeed = 6f;
        r = gameObject.GetComponent<Rigidbody2D>();
        if (GameObject.FindGameObjectWithTag("GameMaster") != null)
            gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<gameMaster>();

		target = GameObject.FindWithTag("Player").transform;
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        rb2d = gameObject.GetComponent<Rigidbody2D>();
        anim = gameObject.GetComponent<Animator>();

        // For health vars
        currHealth = maxHealth;

		c = this.GetComponent<Renderer>().material.color;

        if (GameObject.FindGameObjectWithTag("GameMaster") != null)
            gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<gameMaster>();
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        if (GameObject.FindGameObjectWithTag("GameMaster") != null)
            gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<gameMaster>();


		// doesn't work... just spawn at appropriate locations
        /*RaycastHit hit;
        Ray ray = new Ray(transform.position + Vector3.up * 100, Vector3.down);

        if (Physics.Raycast(ray, out hit, Mathf.Infinity, mask))
        {
            if (hit.collider != null)
            {
                transform.position = new Vector3(transform.position.x, hit.point.y + 20f, transform.position.z);
            }
        }*/

        /* float newYPos = Terrain.activeTerrain.SampleHeight (transform.position) + 20f;
		transform.position = new Vector3 (transform.position.x, newYPos, transform.position.z);*/
    }
Пример #6
0
    public float spawnRateController = 1.0f; // How fast does shit spawn?

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Create an instance of GameMaster
        inst = this;
    }
 void Start()
 {
     gm = GameObject.FindGameObjectWithTag("gameMaster").GetComponent<gameMaster>();
 }
Пример #8
0
    // Use this for initialization
    void Start () {
        r = gameObject.GetComponent<Rigidbody2D>();
		if (GameObject.FindGameObjectWithTag("GameMaster") != null)
			gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<gameMaster>();
    }