public override bool OnTrigger(LCharacterColliderData cdata, Collider other, LChatacterInterface character, LChatacterInformationInterface information) { if (cdata.type == "tra") { LCharacterTransferData data = cdata.getData <LCharacterTransferData>(); jumpSpeed = data.speed; jumpHeight = data.height; beginPositon = character.GetCurPosition(); endPositoin = data.target.position; return(true); } return(false); }
private void Start() { LCharacterHitDataCmp hdc = GetComponent <LCharacterHitDataCmp>(); if (null == hdc) { hdc = gameObject.AddComponent <LCharacterHitDataCmp>(); } LCharacterColliderData cdata = hdc.data; LCharacterTransferData data = new LCharacterTransferData(); cdata.type = "tra"; data.target = target; data.height = height; data.speed = speed; cdata.data = data; }
private void Start() { if (gameObject.layer < 2) { gameObject.layer = GlobalCamp.globalCampInformations[0].other; } LCharacterHitDataCmp hdc = GetComponent <LCharacterHitDataCmp>(); if (null == hdc) { hdc = gameObject.AddComponent <LCharacterHitDataCmp>(); } hdc.needTouchState = false; LCharacterColliderData cdata = hdc.data; LCharacterTransferData data = new LCharacterTransferData(); cdata.type = "tra"; data.target = target; data.height = height; data.speed = speed; cdata.data = data; Collider c = gameObject.GetComponent <Collider>(); if (null == c) { BoxCollider b = gameObject.AddComponent <BoxCollider>(); b.isTrigger = true; } else { c.isTrigger = true; } }