public RunAwayAction(GameObject blob) { this.blob = blob; blobMovement = blob.GetComponent <BlobMovement>(); teamTag = blob.GetComponent <TaggedObject>().teamTag; blobStats = blob.GetComponent <BlobStats>(); }
public EatAction(GameObject blob, List <List <ObjectTag> > edibleTagCombinations) { this.blob = blob; energy = blob.GetComponent <Energy>(); blobMovement = blob.GetComponent <BlobMovement>(); EdibleTagCombinations = edibleTagCombinations; blobStats = blob.GetComponent <BlobStats>(); }
// Use this for initialization void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playerTalk = player.GetComponent <PlayerTalk>(); playerMovement = player.GetComponent <PlayerMovement>(); blobMovement = this.GetComponent <BlobMovement>(); engaged = false; }
public MeleeFightAction(GameObject blob) { this.blob = blob; blobMovement = blob.GetComponent <BlobMovement>(); blobAnimationController = blob.GetComponent <AnimationController>(); blobStats = blob.GetComponent <BlobStats>(); teamTag = blob.GetComponent <TaggedObject>().teamTag; blobAnimationController.OnKicked += DealDamage; }
// Start is called before the first frame update void Start() { for (int i = 0; i < nrOfBlobs; i++) { GameObject child = new GameObject(); child.transform.parent = this.gameObject.transform; child.transform.position = new Vector3(Random.value * 1.5f, i, Random.value * 1.5f); m_collider = child.gameObject.AddComponent <SphereCollider>(); rb = child.gameObject.AddComponent <Rigidbody>(); rb.useGravity = false; movement = child.gameObject.AddComponent <BlobMovement>(); rb.collisionDetectionMode = CollisionDetectionMode.Continuous; rb.mass = 1.0f; float floatationRadius = Mathf.Pow(((3.0f * rb.mass) / (4.0f * Mathf.PI)), (1f / 3f)); float r = Random.Range(0f, 0.05f); m_collider.radius = floatationRadius + r; } }
public WanderAction(GameObject blob) { blobMovement = blob.GetComponent <BlobMovement>(); }
// Use this for initialization void Start() { rig = GetComponent <Rigidbody2D>(); moveScript = GetComponent <BlobMovement>(); }
// Use this for initialization void Start() { hintText.text = hintTextString; showOnClick.SetActive(false); moveScript = player.GetComponent <BlobMovement>(); }
// Use this for initialization void Start() { animator = GetComponent <Animator>(); boxCollider2D = GetComponent <BoxCollider2D>(); blobMovement = GetComponent <BlobMovement>(); }