예제 #1
0
 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);
 }
예제 #2
0
    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;
    }
예제 #3
0
    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;
        }
    }