Beispiel #1
0
    //Podświetlone miejsca do których trzeba podejść
    //public GameObject GoTo;

    //protected GameObject GoToInst;

    //public Transform GoToTransform;

    //private void ShowGoTo()
    //{
    //   if (GoTo != null && GoToTransform != null)
    //       GoToInst = Instantiate(GoTo, GoToTransform.position, GoToTransform.rotation);
    //}

    //private void DestroyGotTo()
    //{
    //    if (GoToInst != null) Destroy(GoToInst);
    //}

    //Funkcja po której wywołaniu startuje event
    //Powinna zapamiętać na starcie parametry zmienianych obiektów
    public override void StartEvent()
    {
        base.StartEvent();
        destinationInstance    = Instantiate(destination);
        clawInstance           = Instantiate(claw);
        clawControllerInstance = Instantiate(clawController);
        clawControllerScript   = clawControllerInstance.GetComponent <ClawController>();
    }
Beispiel #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        ClawController cController = other.GetComponent <ClawController>();

        if (cController != null)
        {
            cController.updateHealth(damageNumb * -1);
        }
    }
Beispiel #3
0
 void Awake () {
     controller = GetComponentInParent<ClawController>();
     coll = GetComponent<Collider2D>();
     clawInitialPos = coll.bounds.center;
     heroStrong = FindObjectOfType<HeroStrong> ();
     heroFast = FindObjectOfType<HeroFast> ();
     heroStrongRigidBody = heroStrong.GetComponent<Rigidbody2D>();
     heroFastRigidBody = heroFast.GetComponent<Rigidbody2D>();
 }
Beispiel #4
0
    void OnCollisionEnter2D(Collision2D other)
    {
        ClawController cController = other.gameObject.GetComponent <ClawController>();

        if (cController != null)
        {
            cController.updateHealth(-1);
        }
    }
Beispiel #5
0
 void Awake()
 {
     controller          = GetComponentInParent <ClawController>();
     coll                = GetComponent <Collider2D>();
     clawInitialPos      = coll.bounds.center;
     heroStrong          = FindObjectOfType <HeroStrong> ();
     heroFast            = FindObjectOfType <HeroFast> ();
     heroStrongRigidBody = heroStrong.GetComponent <Rigidbody2D>();
     heroFastRigidBody   = heroFast.GetComponent <Rigidbody2D>();
 }
Beispiel #6
0
    void OnTriggerEnter2D(Collider2D other)
    {
        ClawController cController = other.GetComponent <ClawController>();

        if (cController != null)
        {
            cController.updateHealth(valor);
            Debug.Log("UHUL CUREI " + valor);
            Destroy(gameObject);
        }
    }
Beispiel #7
0
 void Start()
 {
     platform                 = GetComponentInChildren <PlatformEffector2D>();
     platformCollider         = platform.GetComponent <BoxCollider2D>();
     platformCollider.enabled = false;
     platformTrigger.enabled  = false;
     distJoint                = GetComponent <DistanceJoint2D>();
     distJoint.enabled        = false;
     distJoint.distance       = 0;
     initialPos               = transform.position;
     controller               = GetComponentInParent <ClawController>();
 }