void OnCollisionEnter(Collision collision)
    {
        GameObject obj = collision.gameObject;

        if (obj.tag == "bug" && m_controller.CanPickupBug())
        {
            BugController bug = obj.GetComponent <BugController> ();
            bug.GetStuck(gameObject);
            m_bugs.Add(bug);

            if (bug.IsShootable())
            {
            }
            else
            {
                return;
            }
        }
        else if (obj.tag == "player")
        {
            TongueController player = obj.GetComponent <TongueController> ();
            player.Strike();

            Vector3 f = m_controller.GetTongueVelocity();
            f.y = 20f;
            f  *= 15.0f;
            collision.rigidbody.AddForce(f);
        }

        m_controller.RetractTongue();
    }
Exemple #2
0
 void Awake()
 {
     playerSprite     = GetComponent <SpriteRenderer>();
     rb               = GetComponent <Rigidbody2D>();
     tongueController = GetComponent <TongueController>();
     collider         = GetComponent <CircleCollider2D>();
 }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        tongueController = GetComponent <TongueController>();
        maxLength        = tongueController.maxTongueLength;
        count            = Mathf.CeilToInt(maxLength / 2);
        playerRb         = GetComponent <Rigidbody2D>();
        playerPos        = new Vector2(playerRb.transform.position.x, playerRb.transform.position.y);

        crosshair.transform.localScale = new Vector2(crosshairScale, crosshairScale);
    }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     firstPersonCamera.enabled = true;
     body.renderer.enabled     = false;
     thirdPersonCamera.enabled = false;
     controller = GameObject.Find("TongueEnd").GetComponent <TongueController> ();
     gun        = GameObject.Find("Gun");
     plunger    = GameObject.Find("Plunger");
     line       = GameObject.Find("Line");
 }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     firstPersonCamera.enabled = true;
     body.renderer.enabled = false;
     thirdPersonCamera.enabled = false;
     controller = GameObject.Find ("TongueEnd").GetComponent<TongueController> ();
     gun = GameObject.Find ("Gun");
     plunger = GameObject.Find ("Plunger");
     line = GameObject.Find ("Line");
 }
    protected override void ReachedChaseTarget(GameObject target)
    {
        TongueController tc = target.GetComponent <TongueController>();

        tc.Strike();

        Rigidbody r = target.GetComponent <Rigidbody>();
        Vector3   f = transform.forward * 400;

        r.AddForce(f);
    }
    // Use this for initialization
    void Start()
    {
        m_rigidbody        = GetComponent <Rigidbody>();
        playerInput        = GetComponent <PlayerInput>();
        animator           = GetComponentInChildren <Animator>();
        m_tongueController = GetComponent <TongueController> ();
        m_speedMult        = 1.0f;

        m_collider   = GetComponent <SphereCollider> ();
        m_isGrounded = true;
    }
	// Use this for initialization
	void Awake () {
		health = 40;
		ctrl = new TongueController (this, new List<Player>(GameObject.FindObjectsOfType<Player>()));

		disableFaces2 ();
		idleFace2[Random.Range(0,idleFace2.Length)].SetActive (true);

		plane.Owner = this;
		plane.Mask = AttackPlane.HitMask.Hero;
		plane.LifeSpan = -100;
		plane.Direction = AttackPlane.AttackDirection.Static;

        StartCoroutine(BackgroundSound());
	}
    // Use this for initialization
    public override void Init()
    {
        m_tongueController = GetComponentInParent <TongueController>();

        cps = new List <Transform> ();
        ps  = new List <Vector3> ();
        ts  = new List <Vector3> ();
        ms  = new List <Vector3> ();

        Mesh mesh = new Mesh();

        meshBuilder = new MeshBuilder(mesh);
        SetMesh(mesh);

        m_tongueTip = m_tongueController.GetTongueTip();
    }
 public void SetController(TongueController controller)
 {
     m_controller = controller;
 }
Exemple #11
0
    // Update is called once per frame
    void Update()
    {
        TongueController c = GameObject.Find("TongueEnd").GetComponent <TongueController>();

        print(c.getStage().ToString());
    }
Exemple #12
0
 void Awake()
 {
     rb = GetComponent <Rigidbody2D>();
     tongueController = GetComponent <TongueController>();
 }
Exemple #13
0
 void Awake()
 {
     moveController   = GetComponent <MoveController>();
     tongueController = GetComponent <TongueController>();
 }