//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>(); }
void OnTriggerEnter2D(Collider2D other) { ClawController cController = other.GetComponent <ClawController>(); if (cController != null) { cController.updateHealth(damageNumb * -1); } }
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>(); }
void OnCollisionEnter2D(Collision2D other) { ClawController cController = other.gameObject.GetComponent <ClawController>(); if (cController != null) { cController.updateHealth(-1); } }
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>(); }
void OnTriggerEnter2D(Collider2D other) { ClawController cController = other.GetComponent <ClawController>(); if (cController != null) { cController.updateHealth(valor); Debug.Log("UHUL CUREI " + valor); Destroy(gameObject); } }
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>(); }